diff options
| author | Jeff Carr <[email protected]> | 2019-06-17 08:09:28 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-17 08:09:28 -0700 |
| commit | 1f97a3cfa156255ece44878e15ef1750e663a384 (patch) | |
| tree | ae92980a4ff1eafc26101b0ce47dbce09155ef22 | |
| parent | 37d30e4c41759343f8d594eaa9881c933f17c6d7 (diff) | |
allow a custom Exit()
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | structs.go | 1 | ||||
| -rw-r--r-- | window.go | 8 |
2 files changed, 8 insertions, 1 deletions
@@ -19,6 +19,7 @@ type GuiConfig struct { Height int Debug bool DebugTable bool + Exit func(*GuiWindow) } type GuiData struct { @@ -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 }) |
