Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Keep dialog input window open after button press

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126520] Re: Keep dialog input window open after button press
  • From: A Retey <awnl at gmx-topmail.de>
  • Date: Wed, 16 May 2012 05:59:02 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jovoce$mj8$1@smc.vnet.net>

Am 16.05.2012 10:26, schrieb Christina:
> I have the following code which creates a button panel which links to other Mathematica scripts.
>
> I would like to have it such that after a button press the panel remains open and active for another button press, then only closes when the done button is pressed.
>
> 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[Done, DialogReturn["10"]]}]}]];
>
> If[menu == "1", Get["/A.m"]]
> If[menu == "2", Get["/B.m"]]
>

for that, don't use the modal DialogInput but just CreateDialog:

CreateDialog[
  DialogNotebook[{
    Column[{
      TextCell[Row[{Style["I would like to ...", FontWeight -> Bold]}],
        "Text"],
      Row[{
        Button["Run A", Get["/A.m"]],
        Button["Run B", Get["/B.m"]]
        }],
      Button["Done", DialogReturn[]]
      }]
    }]
  ]

hth,

albert



  • Prev by Date: Crash in FindShortestPath (bug)
  • Next by Date: Re: Crash in FindShortestPath (bug)
  • Previous by thread: Keep dialog input window open after button press
  • Next by thread: Crash in FindShortestPath (bug)