# Interface design to replace cascading dialogs which don't work

I would like to make a nice Interface of a simulation I wrote, but i don't know how.

I want that you run the code and then a window asking for input of some values appears (either in the same notebook or an additional window, I don't mind). There should be of course some Inputfields and a button that gives the option to set other values to, kind of advanced setting. If that button is not pushes, I want to transmit standard values for those. That can look like this:

or like this:

The codes for those results are

 DialogInput[
InputField[Dynamic[a], Number],
PopupMenu[Dynamic[b], {"x", "y", "z"}, String], "\n",
Grid[{{DefaultButton["further settings",
DialogNotebook[
InputField[Dynamic[c], Number]}, {TextCell[
InputField[Dynamic[d], Number]}, {DefaultButton[
DialogReturn[{a, b, c, d}]], CancelButton[]}}]]]],
DefaultButton[DialogReturn[{a, b, c, d}]], , ,
CancelButton[]}}]}]];


and

DynamicModule[{a = 0, b = 0, c = 15, d = 20},
Deploy[Style[
Panel[Grid[
"further settings :",
Button["OK", startCalculation[],
Method -> "Queued"]}, {InputField[Dynamic[a], Number],
PopupMenu[Dynamic[b], {1 -> "x", 2 -> "y", 3 -> "z"}, String],
Button["further settings ",
DialogNotebook[
InputField[c, Number]}, {TextCell[
InputField[d, Number]}, {DefaultButton[
DialogReturn[{a, b, c, d}]], CancelButton[]}}]]],
Method -> "Queued"], SpanFromLeft}}], Alignment -> Center],
ImageMargins -> 10],
DefaultOptions -> {InputField -> {ContinuousAction -> True,
FieldSize -> {{30, 30}, {1, Infinity}}}}]]];


respectively.

After the first Interface, the normal calculation starts. Since mathematica is waiting for the results of the Dialog, the only problem there is setting the further settings.

In the second Interface I do not know how to start the real calculation, since mathematica is finishing the evaluation after showing the Interface.

Unfortunately, I am already struggeling with this for days and neither I get those Interfaces working properly , nor I find good alternatives for what I want to do.

Does one has a hint how I can fix those Interfaces or knows a better way of doing one that fullfill my contraints?

• Sorry I do not exactly get what you mean. Are you talking about the first or the second solution? What exactly should I close and open and where? Cheers – Stefan Sailer Apr 26 '16 at 12:12
• Sorry I may have missed something but don't have more time now. Will try to be back later. Shortly, I don't think it is possible to open Kernel blocking dialog from within another kernel blocking dialog, you have to rearrange your work scheme. – Kuba Apr 26 '16 at 12:35
• It doesn't necessarily need to look exactly like that. If it's possible to like expand the first dialog window, so that the additional fields appear when you push the button or similar that's also fine. I just want those further settings only to appear in case the button is pushed, if not they should have some fixed values. Is this possible somehow? Thanks for your help so far already! – Stefan Sailer Apr 26 '16 at 12:47
• If you read the note under Details and Options in the documentation for DialogInput you will find that your interface design will not work because input dialogs are modal in Mathematica. – m_goldberg Apr 26 '16 at 12:47
• The way I would do it would be to use a single dialog with a tab view (TabView) with one tab labeled Basic Settings and the other labeled More Settings. – m_goldberg Apr 26 '16 at 13:03