MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Grabbing a value from a Dynamic Object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86856] Re: Grabbing a value from a Dynamic Object
  • From: Andrew Moylan <andrew.j.moylan at gmail.com>
  • Date: Sun, 23 Mar 2008 03:28:45 -0500 (EST)
  • References: <fs4rrq$p93$1@smc.vnet.net>

I don't think you need CurrentValue. Try evaluating this example:

PopupMenu[Dynamic[x], Range[12]]
Dynamic[PopupMenu[Dynamic[y], Range[x]]]

Is that what you want?


On Mar 23, 5:03 pm, Todd Allen <genesplice... at yahoo.com> wrote:
> Hi Folks,
>
>    I am trying to use a series of control objects,
> specifically PopupMenus, so that the input to one
> PopupMenu will be used dynamically to provide the
> range of values for the subsequent PopupMenu.
>
>    My area is not computer science, but I believe I
> get the idea that Dynamic is not evaluated in the
> kernal, but rather simply formatted in the front end
> of Mathematica.  To extract a Dynamic value I have
> been attempting to use the command CurrentValue with
> no sucess.
>
> Here is my basic code:
>
> x = Null; y = Null;
> totgrades = PopupMenu[Dynamic[x], Range[12]]
> temp1 = CurrentValue[totgrades]
> gradesnow = PopupMenu[Dynamic[y], Range[temp1]]
>
> I keep getting the error message:
>
> "Range::range: Range specification in
> Range[FrontEnd`CurrentValue[BoxData[3]]] does not have
> appropriate bounds. >>"
>
> I understand that the Head of temp1 is NOT a number,
> but rather is a FrontEnd`CurrentValue.......so, how do
> I get a number that the second PopupMenu can actually
> use to produce a range of potential inputs from the
> user?
>
> I certainly appreciate any advice you might have!
> Mathematica is a wonderful piece of software, but
> there are times when it is truly frustating for a
> beginner.
>
> Best regards,
> Todd
>
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.http://www.yahoo.com/r/hs



  • Prev by Date: SoundNote: velocity?
  • Next by Date: Re: Which function can do this?
  • Previous by thread: Grabbing a value from a Dynamic Object
  • Next by thread: Re: Grabbing a value from a Dynamic Object