Mathematica: Dialog button window to remain open after click

  • Context: Mathematica 
  • Thread starter Thread starter ChristinaJ
  • Start date Start date
  • Tags Tags
    Mathematica Window
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
ChristinaJ
Gold Member
Messages
34
Reaction score
1
All,

I have a button panel (code below) where a pressed button initiates a particular Mathematica script.

When the button is pressed the script runs (as it should) but the panel closes. I wish for the panel to remain open so that I can click another button. The panel should close only when the done button is clicked.

Code:
menu = DialogInput[
   DialogNotebook[{Column[{TextCell[
        Row[{Style["I would like to ...", FontWeight -> Bold]}], 
        "Text"], 
       Row[{Button["Run A", DialogReturn["1"]], 
         Button["Run B", DialogReturn["2"]],
         Button["Run C", DialogReturn["3"]]}],
       Button[Done, DialogReturn[]]}]}]];

If[Mags == "1", 
 Get["A.m"]]
If[Mags == "2", 
 Get["B.m"]]
If[Mags == "3", 
 Get["C.m"]]

Any help appreciated.

Many thanks,
Christina
 
Physics news on Phys.org


Solved here thanks to comp.soft-sys.math.mathematica
 
Last edited: