2

I hope you can help me. I want to make a nested dynamic menu and I used the package MoreUI made by Kuba as a reference Question.

My problem is that I want to add tasks such as:

PTX[] := 
  Manipulate[Plot[Sin[a x + b], {x, 0, 6}], 
    {{a, 2, "Multiplier"}, 1, 4}, 
    {{b, 0, "Phase Parameter"}, 0, 10}];

And I added it as another option on the menu.

ActionNestedMenu[
 "Test menu" -> 
    {"lbl 11" :> Print[1],
     "lbl 12" -> {"New Option" :> PTX[], "lbl 22" :> Print[22]},
     "lbl 13" :> Print[3],
     "lbl 14" -> {"lbl 41" :> Print[41], "lbl 42" :> Print[42]},
     "lbl 15" ->
       {"lbl 51" -> {"lbl 511" :> Print[531],"lbl 512" :> Print[532]},
        "lbl 52" :> Print[41],
        "lbl 53" :> Print[42],
        "lbl 54" -> {"lbl 541" :> Print[531], "lbl 542" :> Print[532]}}}]

But when I run it, it does not do anything!

Is this fragment of the code the one that I will have to modify?

Fragment pf code from MoreUI:

Initialization :> (
  thisBox = EvaluationBox[])
user64494
  • 26,149
  • 4
  • 27
  • 56
  • 1
    But what do you want to happen? You Manipulate will be evaluated but won't appear anywhere, same story if you put PTX[] in Button or ActionMenu. You can e.g. MessageDialog @ PTX[]. – Kuba May 08 '19 at 22:59
  • I want that when you choose a menu option then show what that option does, in this case, a graph. Thank you, Kuba! The instruction you provided worked. I am not an expert in Mathematica but I want to continue learning. – Tomás Valencia May 08 '19 at 23:16

1 Answers1

1

The solution is to change:

"New Option" :> PTX[],

by

"New Option" :> MessageDialog@PTX[],

Thanks to Kuba.