Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14169 > unrolled thread

Trying to suspend or pause execution of a program.

Started byClif McInnis <c_mcinnis@hotmail.com>
First post2013-04-13 06:02 +0000
Last post2013-04-16 04:34 +0000
Articles 3 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Trying to suspend or pause execution of a program. Clif McInnis <c_mcinnis@hotmail.com> - 2013-04-13 06:02 +0000
    Re: Trying to suspend or pause execution of a program (Updated). Clif McInnis <c_mcinnis@hotmail.com> - 2013-04-16 04:34 +0000
    Re: Trying to suspend or pause execution of a program.(updated) Clif McInnis <c_mcinnis@hotmail.com> - 2013-04-16 04:34 +0000

#14169 — Trying to suspend or pause execution of a program.

FromClif McInnis <c_mcinnis@hotmail.com>
Date2013-04-13 06:02 +0000
SubjectTrying to suspend or pause execution of a program.
Message-ID<kkase2$rjd$1@smc.vnet.net>
I have a manipulate that uses the Speak function. One of the four buttons used plays a 24 second statement and I would like to have the other buttons disabled until the Speak function has finished. The best that I have been able to do is to disable the other buttons for 6 to 7 seconds, by using a Pause statement along with Method and SynchronousUpdating. I would certainly appreciate any and all suggestions.

[toc] | [next] | [standalone]


#14194 — Re: Trying to suspend or pause execution of a program (Updated).

FromClif McInnis <c_mcinnis@hotmail.com>
Date2013-04-16 04:34 +0000
SubjectRe: Trying to suspend or pause execution of a program (Updated).
Message-ID<kkikce$rno$1@smc.vnet.net>
In reply to#14169
Here is the program that I am working on. It is just a little counting exercise for K and Pre-K. The problem is that you can press buttons that will cause the number of balls on the screen to be quite different from what is being said. I have worked with putting "Pause" in several places; for different lengths of time, and using Enabled->False/(True) in an attempt to make the buttons inactive until the computer had finished "speaking". So far none of what I have tried has helped, so I was hoping to get some suggestions from the community.

Clif McInnis

Manipulate[
 Pane[Column[{Text[
     Row[If[n < 2, {Spacer[160],
        Style[nnames[[n]], Bold, Large, Hue[RandomReal[]]],
        Style[" Ball", Bold, Large, Green]}, {Spacer[160],
        Style[nnames[[n]], Bold, Large, Hue[RandomReal[]]],
        Style[" Balls", Bold, Large, Green]}]]],
    Row[Table[Graphics[{
        Darker[Green], Disk[],
        Text[
         Style[numerals[[ r]], Orange, "Label", 48], {0, 0}]}], {r, 1,
        n}]
     ]}, BaseStyle -> {LinebreakAdjustments -> {1., 10, 0, 0,
       10}}], {525, 300}],
 Row[{Button[
    " Start  \n ", {n = 1,
     Speak["lets count the numbers 1 to 10 out loud. One"]}],
   Spacer[55],
   Button[
    "\[FilledLeftTriangle]\[FilledLeftTriangle] Start Over", {n = 1,
     Speak["one"]}],
   Button[
    "\[FilledLeftTriangle] Less", {If[
      n < 2, {n = 1,
       Speak["Today we are just working on the numbers from one to \
ten."]}, {n -= 1, Speak[n]}]}], Spacer[10],
   Button[
    "More \[FilledRightTriangle]", {If[
      n > 9, {n = 10,
       Speak["Lets learn the numbers from one to ten before we go \
on."]}, {n += 1, Speak[n]}]}],
   Button[
    "All \[FilledRightTriangle]\[FilledRightTriangle]", {n = 10,
     Speak["ten"]}]
   }],
 {{n, 1, " "}, ControlType -> None},
 SynchronousUpdating -> False,
 Initialization :> (
   numerals = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10",};
   nnames = {"One", "Two", "Three", "Four", "Five", "Six", "Seven",
     "Eight", "Nine", "Ten"};
   )]

[toc] | [prev] | [next] | [standalone]


#14197 — Re: Trying to suspend or pause execution of a program.(updated)

FromClif McInnis <c_mcinnis@hotmail.com>
Date2013-04-16 04:34 +0000
SubjectRe: Trying to suspend or pause execution of a program.(updated)
Message-ID<kkikcu$ro3$1@smc.vnet.net>
In reply to#14169
This is the manipulate that I was talking about (I added another button). It is an attempt to help Pre-Kindergarten and Kindergarten children learn about the numerals and numbers from one to 9. The problem is that it is easy to get the audio out of sync with the graphics. I have played around with Pause[different values] and Enabled->False/Enabled->True as well as SynchronousUpdating -> False. I was hoping that someone might be able to tell me whether I was on the right track; if there is a different function I should look at; or (most important) if what I am trying to do is not doable.(I want to thank John Fultz for contributions previously made to this manipulate.)
Thank You, Clif McInnis

Manipulate[
 Pane[Column[{Text[
     Row[If[n < 2, {Spacer[160],
        Style[nnames[[n]], Bold, Large, Hue[RandomReal[]]],
        Style[" Ball", Bold, Large, Green]}, {Spacer[160],
        Style[nnames[[n]], Bold, Large, Hue[RandomReal[]]],
        Style[" Balls", Bold, Large, Green]}]]],
    Row[Table[Graphics[{
        Darker[Green], Disk[],
        Text[Style[numerals[[ r]], Orange, "Label", 48], {0,
          0}]}], {r, 1, n}]
     ]}, BaseStyle -> {LinebreakAdjustments -> {1., 10, 0, 0,
       10}}], {525, 300}],
 Row[{Button[
    " Start  \n ", {n = 1,
     Speak["lets count the numbers 1 to 9 out loud. One"]}],
   Spacer[55],
   Button[
    "\[FilledLeftTriangle]\[FilledLeftTriangle] Start Over", {n = 1,
     Speak["one"]}],
   Button[
    "\[FilledLeftTriangle] Less", {If[
      n < 2, {n = 1,
       Speak["Today we are just working on the numbers from one to \
nine."]}, {n -= 1, Speak[n]}]}], Spacer[10],
   Button[
    "More \[FilledRightTriangle]", {If[
      n > 8, {n = 9,
       Speak["Lets learn the numbers from one to nine before we go \
on."]}, {n += 1, Speak[n]}]}],
   Button[
    "All \[FilledRightTriangle]\[FilledRightTriangle]", {n = 9,
     Speak["nine"]}]
   }],
 {{n, 9, " "}, ControlType -> None},
 Initialization :> (
   numerals = {"1", "2", "3", "4", "5", "6", "7", "8", "9"};
   nnames = {"One", "Two", "Three", "Four", "Five", "Six", "Seven",
     "Eight", "Nine"};

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web