Jul-28-2020, 10:59 PM
In a script you can write some text, prompt for input, and perform some action based on the input. In a GUI you cannot use this pattern because the GUI cannot control what the user does next. If you draw a window with a menu the user might close your window and not make a menu selection. This must be allowed. In a GUI application you would draw the window with the menu, and specify a function to call when the menu selection is made.
So if your logic is:
Make menu
Draw menu
Wait for selection
Process selection
You should change it to:
Make menu, bind menu to call Process selection
Draw Menu
So if your logic is:
Make menu
Draw menu
Wait for selection
Process selection
You should change it to:
Make menu, bind menu to call Process selection
Draw Menu