diff options
| author | Jeff Carr <[email protected]> | 2024-02-07 08:48:02 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-07 08:48:02 -0600 |
| commit | 6a1b386ca57774d5f991700d2d22283ffb3d86f8 (patch) | |
| tree | 2768db1b5701c567c84a33633b6802be7a29c791 /basicWindow.go | |
| parent | d52f6a6903ed8b2e21397c99e0b17dcce2eb9073 (diff) | |
allow windows to be created off the root nodev0.20.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'basicWindow.go')
| -rw-r--r-- | basicWindow.go | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/basicWindow.go b/basicWindow.go index 81f6d72..58c30cd 100644 --- a/basicWindow.go +++ b/basicWindow.go @@ -14,17 +14,27 @@ type BasicWindow struct { vertical bool title string - parent *gui.Node + // parent *gui.Node win *gui.Node // window widget box *gui.Node // box Custom func() } +func RawBasicWindow(title string) *BasicWindow { + var w *BasicWindow + w = &BasicWindow{ + title: title, + vertical: false, + } + log.Log(GADGETS, "NewBasicWindow() END") + + return w +} + func NewBasicWindow(parent *gui.Node, title string) *BasicWindow { var w *BasicWindow w = &BasicWindow{ - parent: parent, title: title, vertical: false, } @@ -118,9 +128,6 @@ func (w *BasicWindow) Initialized() bool { if w == nil { return false } - if w.parent == nil { - return false - } return true } @@ -129,9 +136,6 @@ func (w *BasicWindow) Ready() bool { if !w.Initialized() { return false } - if !w.parent.Ready() { - return false - } return w.ready } @@ -165,7 +169,8 @@ func (w *BasicWindow) Make() { log.Log(GADGETS, "BasicWindow.Make() window was already created") return } - w.win = w.parent.RawWindow(w.title) + // w.win = w.parent.RawWindow(w.title) + w.win = gui.RawWindow(w.title) // if Custom isn't set, set it here. This prevents the application from // os.Exit() if the window is closed. It destroy's the widgets in the toolkit plugins |
