allow a custom Exit()

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-17 08:09:28 -07:00
parent 291f18c1c0
commit c55a039042
2 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,7 @@ type GuiConfig struct {
Height int
Debug bool
DebugTable bool
Exit func(*GuiWindow)
}
type GuiData struct {

View File

@ -83,7 +83,13 @@ func InitWindow(gw *GuiWindow, name string, axis int) *GuiBox {
newGuiWindow.UiWindow.OnClosing(func(*ui.Window) bool {
log.Println("initTabWindow() OnClosing() THIS WINDOW IS CLOSING newGuiWindow=", newGuiWindow)
ui.Quit()
// newGuiWindow.UiWindow.Destroy()
if (Config.Exit == nil) {
ui.Quit()
} else {
// allow a custom exit function
Config.Exit(&newGuiWindow)
}
return true
})