Closed richrarobi closed 5 years ago
What is your code for the exit button, and for the window closing event?
Derived from one of the example buttons:-
button = ui.NewButton("Exit") button.OnClicked(func(*ui.Button) { mainwin.Destroy() }) grid.Append(button, 3, 0, 1, 1, false, ui.AlignFill, false, ui.AlignFill)
Sorry, hit the wrong button!
And what is your mainwin OnClosing?
learn.go.zip This is the "whole program" - when I hit exit, it doesn't go back to a prompt, or exit if it has its own window.
Might have sorted it, I changed ui.Destroy to ui.Quit. Now I get the close window prompt... My newness to gtk3, I guess? ( Is this the "best" way?)
In a direct call within command line box, it goes straight back to the prompt properly. (with ui.Quit within the action for exit button)
Yes, ui.Quit
is the function that you call to tell ui.Main
to return.
Thanks ....
What is the best way to implement an Exit button. I have tried calling ui.Destroy (on Linux) it leaves the app "running" - needs ctrl-c to get back to prompt. (This was derived from your gallery example, I am trying to implement a simple buttons only control panel) If I just close the main box the app exits properly. I can't find an example of exit, and can't see what syntax for Quit...
(Perhaps a quit or exit button for the gallery example?) Thanks