diff options
| author | Jeff Carr <[email protected]> | 2021-10-04 14:39:38 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2021-10-04 14:39:38 -0500 |
| commit | a1800a79e5fc4a4f7757a18885c5b8295c8b7cdc (patch) | |
| tree | d4b5b78a18bde97145ca8e9996294ab8a4d81747 /window.go | |
| parent | 40252b179d65028ff96b52c22401e69cecb4004b (diff) | |
WINDOW: add CreateWindow that has proper padding
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'window.go')
| -rw-r--r-- | window.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -162,3 +162,28 @@ func DeleteWindow(name string) { } } } + +// CreateWindow("my title", "my tabname", 300, 200, makeNumbersPagewin2) +func CreateWindow(title string, tabname string, x int, y int, custom func() ui.Control) *ui.Window { + 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 + }) + + tab := ui.NewTab() + window.SetChild(tab) + window.SetMargined(true) + + tab.Append(tabname, custom()) + tab.SetMargined(0, true) + + window.Show() + + return window +} |
