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 return true
case widget.Window: case widget.Window:
log.Log(INFO, "Adding Something to Window", n.WidgetId, n.GetProgName()) 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) ptk.uiWindow.SetChild(tk.uiControl)
return true return true
default: default:

View File

@ -3,6 +3,8 @@ package main
import ( import (
"go.wit.com/dev/andlabs/ui" "go.wit.com/dev/andlabs/ui"
_ "go.wit.com/dev/andlabs/ui/winmanifest" _ "go.wit.com/dev/andlabs/ui/winmanifest"
"go.wit.com/log"
"go.wit.com/widget"
"go.wit.com/toolkits/tree" "go.wit.com/toolkits/tree"
) )
@ -33,7 +35,11 @@ func newWindow(p, n *tree.Node) {
newt.uiControl = win newt.uiControl = win
n.TK = newt 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() win.Show()
return return
} }