allow windows to be created off the root node
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
d52f6a6903
commit
6a1b386ca5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue