MathGroup Archive 2007

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

Search the Archive

Re: Nested Dialogs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79828] Re: Nested Dialogs
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Mon, 6 Aug 2007 03:34:32 -0400 (EDT)
  • References: <f91jmn$7m0$1@smc.vnet.net>

Albert wrote:
> Hi,
> 
> I am trying to create an modal dialog where a user can give some input 
> and which offers another modal dialog for part of the input, because in 
> the real application the input is somewhat lengthy to put into just one 
> dialog. I want both of them to be modal.
> 
> When nesting DialogInput I discovered that the following does not work 
> as I expected (hoped) it would:
> 
> DialogInput[{
>    Button["Details", DialogInput[DefaultButton[]]],
>    DefaultButton[]
> }]
> 
> actually it hangs mathematica, so it will ask whether you want to wait
> or abort the dynamic evaluation. When experimenting with CreateDialog I 
> found it has the option Modal, but this option does not really seem to 
> change the behaviour of the Dialog. Something else I detected is that 
> for two nested dialogs DialogReturn[] behaves not exactly as I did expect:
> 
> DialogInput[{Button["Details",
>     CreateDialog[DefaultButton[DialogReturn[2]]]],
>    DefaultButton[DialogReturn[1]]}]
> 
> When I click the Button in the nested dialog, the DialogInput returns 2, 
> but the window associated with the DialogInput stays on the screen.
> 
> I could not find something about the
> nesting of Dialogs in the Documentation Center so here are my questions:
> 
> - am I misunderstanding or missing something?
> - am I asking for too much?
> - Is this the intended behavior?
> - I am using 6.0.0. Has the situation with 6.0.1 changed for these
>    things?
> - Has anyone some workaround to achieve what I try to do (I know how to
>    do this with JLink, but then I don't have easy access to all the nice
>    dynamic stuff within the dialogs...)?
> 
> albert
> 
It hangs for me too. You can create nested (Java) dialog boxes with my 
free SuperWidgetPackage. For example:

Needs["SuperWidgetPackage`"]

l2[_] := {"Level 2", SuperWidgetButton[Null, "Ok", 1]} //
    SuperGUIRunModal;

{"Level 1", {SuperWidgetButton[Null, "Deeper", l2],
    SuperWidgetButton[Null, "OK", 1]}} // SuperGUIRunModal

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Re: Changing "point" styles in 3D plots
  • Next by Date: Re: Integro-differential analog of Love's equation via power series
  • Previous by thread: Nested Dialogs
  • Next by thread: Re: Nested Dialogs