Tweeted twitter.com/StackMma/status/737105548429164548
2 added 2 characters in body; edited title
source | link

Dialog Notebooknotebook with Multiple PopupMenus[]multiple popup menus

I'm trying to create a user interface in Mathematica;Mathematica; the user will enter specified information, it will be processed, and then data will be inserted into a MySQL database. The pieces work independently but when I put them together, odd things happen.

So for example, this works:

Module[{ss, flist},
 flist = {"f1", "f2", "f3"};
 ss = First[flist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss]}]}]}]];
];

But the following, which seems to be substantially identical, does not. Specifically, if the user doesn't select something new from the popup menus, the variables never get initialized.

Module[{ss, flist, ci, clist},
 flist = {"f1", "f2", "f3"};
 clist = {"c1", "c2", "c3"};
 ss = First[flist];
 ci = First[clist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    PopupMenu[Dynamic[ci], clist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss, ". ci: ", ci]}]}]}]];
 ];

What am I missing?

Dialog Notebook with Multiple PopupMenus[]

I'm trying to create a user interface in Mathematica; the user will enter specified information, it will be processed, and then data will be inserted into a MySQL database. The pieces work independently but when I put them together, odd things happen.

So for example, this works:

Module[{ss, flist},
 flist = {"f1", "f2", "f3"};
 ss = First[flist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss]}]}]}]];
];

But the following, which seems to be substantially identical, does not. Specifically, if the user doesn't select something new from the popup menus, the variables never get initialized.

Module[{ss, flist, ci, clist},
 flist = {"f1", "f2", "f3"};
 clist = {"c1", "c2", "c3"};
 ss = First[flist];
 ci = First[clist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    PopupMenu[Dynamic[ci], clist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss, ". ci: ", ci]}]}]}]];
 ];

What am I missing?

Dialog notebook with multiple popup menus

I'm trying to create a user interface in Mathematica; the user will enter specified information, it will be processed, and then data will be inserted into a MySQL database. The pieces work independently but when I put them together, odd things happen.

So for example, this works:

Module[{ss, flist},
 flist = {"f1", "f2", "f3"};
 ss = First[flist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss]}]}]}]];
];

But the following, which seems to be substantially identical, does not. Specifically, if the user doesn't select something new from the popup menus, the variables never get initialized.

Module[{ss, flist, ci, clist},
 flist = {"f1", "f2", "f3"};
 clist = {"c1", "c2", "c3"};
 ss = First[flist];
 ci = First[clist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    PopupMenu[Dynamic[ci], clist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss, ". ci: ", ci]}]}]}]];
 ];

What am I missing?

1
source | link

Dialog Notebook with Multiple PopupMenus[]

I'm trying to create a user interface in Mathematica; the user will enter specified information, it will be processed, and then data will be inserted into a MySQL database. The pieces work independently but when I put them together, odd things happen.

So for example, this works:

Module[{ss, flist},
 flist = {"f1", "f2", "f3"};
 ss = First[flist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss]}]}]}]];
];

But the following, which seems to be substantially identical, does not. Specifically, if the user doesn't select something new from the popup menus, the variables never get initialized.

Module[{ss, flist, ci, clist},
 flist = {"f1", "f2", "f3"};
 clist = {"c1", "c2", "c3"};
 ss = First[flist];
 ci = First[clist];
 CreateWindow[DialogNotebook[{
    PopupMenu[Dynamic[ss], flist],
    PopupMenu[Dynamic[ci], clist],
    ChoiceButtons[{"Enter", "Cancel"}, {DialogReturn[{Print["ss: ", ss, ". ci: ", ci]}]}]}]];
 ];

What am I missing?