Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Grabbing a value from a Dynamic Object

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86853] Grabbing a value from a Dynamic Object
  • From: Todd Allen <genesplicer28 at yahoo.com>
  • Date: Sun, 23 Mar 2008 01:03:51 -0500 (EST)

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: Re: Re: Re: smallest fraction
  • Next by Date: Re: Viewpoint selector for Mac in 6.0?
  • Previous by thread: Re: Funny behaviour of ClipboardNotebook[] (Q: How to copy programmatically?)
  • Next by thread: Re: Grabbing a value from a Dynamic Object