diff options
| author | Jeff Carr <[email protected]> | 2021-10-04 20:18:51 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2021-10-04 20:18:51 -0500 |
| commit | 36cb4f8afcff24036af35e7f4c61e09d3e632a56 (patch) | |
| tree | c9ed6a7943c634816d317a03f3b9e8168d793d40 /window.go | |
| parent | 34c88156c0da2b98f2c464321ffc4a6d87ab8f98 (diff) | |
WINDOW: add function to create completely blank window
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -182,3 +182,30 @@ func CreateWindow(title string, tabname string, x int, y int, custom func() ui.C return window } + +func CreateBlankWindow(title string, x int, y int) *GuiBox { + window := ui.NewWindow(title, x, y, false) + window.OnClosing(func(*ui.Window) bool { + log.Println("createWindow().OnClosing()", title) + return true + }) + ui.OnShouldQuit(func() bool { + log.Println("createWindow().Destroy()", title) + window.Destroy() + return true + }) + + window.SetMargined(true) + window.Show() + + var newGuiWindow GuiWindow + newGuiWindow.Width = x + newGuiWindow.Height = y + newGuiWindow.Name = title + newGuiWindow.UiWindow = window + + var box GuiBox + box.Window = &newGuiWindow + + return &box +} |
