Hi Cecil,
Am 26.06.18 um 17:17 schrieb Cecil Westerhof:
> In another thread I 'was told' I should use Tk. I am not used to
> programming GUI's, but that does not mean I should not start with it.
> A GUI can certainly be an advantage.
>
> - When executing a command (instead of just printing it) I should
> display another window. But while executing this command I should
> not be able to start another command. How would I circumvent that?
nice to see that you are investigating GUIs. I don't really know what
the whole program is doing, but I have the feeling you might rethink
your overall design when it comes to GUI.
The stereotypical programs you have shown earlier (ask for command, then
ask for which tea, then, ...) is one of the worst possible interfaces
especially because the user has no way to go back, revise a choice, if
they make a mistake, they need to start over and type everything afresh.
Therefore, in a GUI, it usually works differently. Mostly you have all
the settings on the screen at once, in a single window. You can freely
adjust the entries and then there is a button "Run", "Do it" or whatever
to actually start the action and another button to abort the action (or
clicking the x in the window bar).
Since I haven't the whole program, the following advice might be
misguided, but my feeling is: YOu should have one window, where you can
select the "command" and then set the options. This is typically done
such that the left side features a listbox and the right side displays a
varying panel of other entries etc. which are packed/unpacked when you
click the "command". CLicking on a different command than the current
one means "abort". If you want to do such a widget as lazily as
possible, you could use a ttk::notebook, which pages other
widgets/frames in and out.
You were given answers how to wait on a window (so called "modal dialog"
in GUI speak), which is fine, but honestly in several years experience
designing GUIs we always tried to *avoid* modal dialogs. Only for very
standard stuff like prompting for a filename it makes sense. Otherwise
it linearises the program flow too much IMHO.
Christian