MathGroup Archive 2011

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

Search the Archive

PopupMenu Problems

  • To: mathgroup at
  • Subject: [mg122480] PopupMenu Problems
  • From: Don <donabc at>
  • Date: Sat, 29 Oct 2011 07:14:17 -0400 (EDT)
  • Delivered-to:

Below is the code for a simple PopupMenu

The purpose is to present the user with a PopupMenu that
gives two options:  "Linear" or "NonLinear".

There are two problems with this code:

(1) The word "Linear" (the default)  is suppose to show up in 
the window next to the right of the word " Function:".
Right now, it's just left as a blank.  It was thought
that setting the inital value of the variable "fnc1" to Linear
would solve that problem.

(2) After the user makes a choice by clicking on the down arrow and
clicking on an option (Linear or NonLinear) the 
code should then "fall through" and Print "999" to show
it is positioned to determine which option the user chose by
executing the following Which function, but this never happens. 
The act of choosing an option by the user  should  result in executing the Which function and subsequent functions.  

How can this code be modified to fix those two problems?
Thank you in advance.


master$FE[] := Module[{},
  Interpretation[{fnc1 = Linear},
   backgrndClr = ColorData["Aquamarine", 0.15];
      {Style["PopupMenu", 36, Bold], SpanFromLeft
       Style["Function:", Bold, 22],
       PopupMenu[Dynamic[fnc1], {"Linear", 
         "NonLinear"}, AutoAction -> True
          ] , 
     ItemStyle -> Directive[FontSize -> 26, Bold],
     Spacings -> {2, 2},
     Dividers -> {None, {2 -> 
         Directive[Black, AbsoluteThickness[Large]]}}
     ], ImageSize -> {300, 250}, Background -> backgrndClr],
     Print[" Begin Which Function -  999 "];
     fnc1String = ToString[fnc1];
          fnc1String == "Linear",
          fnc1String == "NonLinear",
            ];(* End Which *)
    ](* Interpretation *)
  (* Print["888"];*)
  ](* End Module master$FE *)

  • Prev by Date: Re: Coin Toss Sim
  • Next by Date: Re: Problem with Solve and NSolve
  • Previous by thread: When exactly is an Initialization (for Dynamic, Module, etc.) evaluated?
  • Next by thread: Re: PopupMenu Problems