Jan-25-2021, 07:13 AM
(This post was last modified: Jan-25-2021, 07:13 AM by deanhystad.)
A GUI application runs all the time, though most of the time it is doing nothing but waiting for the user to click a mouse button or press a key. The windows or Linux desktop is a GUI. Do you stop and restart windows each time you want to run a program?
GUI's are event driven, and the user provides the events. I would expect your GUI to have some code that gets called when a button is pressed, and when the event handler code completes the GUI goes back to waiting for the next event. If you need to disable the button while the event is being processed, that is easily done. But the GUI is running all the time. No recursion. No stopping and restarting. Not even a loop as far as you are concerned.
If you already have code that does the complicated task you could write a very simple GUI application that runs your complicated application as a subprocess.
GUI's are event driven, and the user provides the events. I would expect your GUI to have some code that gets called when a button is pressed, and when the event handler code completes the GUI goes back to waiting for the next event. If you need to disable the button while the event is being processed, that is easily done. But the GUI is running all the time. No recursion. No stopping and restarting. Not even a loop as far as you are concerned.
If you already have code that does the complicated task you could write a very simple GUI application that runs your complicated application as a subprocess.