avoid window in window crash. TODO: make it work

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-15 08:15:38 -06:00
parent c6f9119c2e
commit c5ecf7ca32
2 changed files with 11 additions and 1 deletions

View File

@ -106,6 +106,10 @@ func place(p *tree.Node, n *tree.Node) bool {
return true
case widget.Window:
log.Log(INFO, "Adding Something to Window", n.WidgetId, n.GetProgName())
if n.WidgetType == widget.Window {
log.Log(INFO, "TODO: make window in a window a tab", n.WidgetId, n.GetProgName())
return true
}
ptk.uiWindow.SetChild(tk.uiControl)
return true
default:

View File

@ -3,6 +3,8 @@ package main
import (
"go.wit.com/dev/andlabs/ui"
_ "go.wit.com/dev/andlabs/ui/winmanifest"
"go.wit.com/log"
"go.wit.com/widget"
"go.wit.com/toolkits/tree"
)
@ -33,7 +35,11 @@ func newWindow(p, n *tree.Node) {
newt.uiControl = win
n.TK = newt
place(p, n)
if p.WidgetType == widget.Window {
log.Log(WARN, "newWindow() TODO: make this window a tab")
} else {
place(p, n)
}
win.Show()
return
}