working on margin()

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-14 10:37:43 -06:00
parent 732edc3faf
commit ebeeed84b4
2 changed files with 14 additions and 2 deletions

View File

@ -36,8 +36,6 @@ func sendAction(n *Node, atype widget.ActionType) {
a.Strings = n.strings
// These should be improved/deprecated based on the gui/widget docs
a.Expand = n.expand
a.X = n.X
a.Y = n.Y

View File

@ -17,6 +17,13 @@ func (n *Node) Show() *Node {
n.hidden = false
n.changed = true
if n.WidgetType == widget.Window {
log.Warn("Show on a hidden window", n.progname)
log.Warn("this needs to do TestDraw()")
n.TestDraw()
return n
}
// inform the toolkits
sendAction(n, widget.Show)
return n
@ -26,6 +33,11 @@ func (n *Node) Hide() *Node {
if ! n.Ready() { return n }
if n.Hidden() { return n }
if n.WidgetType == widget.Window {
log.Warn("Hide on a window", n.progname)
log.Warn("this needs to do TestDestroy() ?")
}
n.hidden = true
n.changed = true
// inform the toolkits
@ -160,6 +172,7 @@ func (n *Node) Margin() *Node {
n.margin = true
n.changed = true
log.Warn("Margin()", n.WidgetType, n.progname)
// inform the toolkits
sendAction(n, widget.Margin)
return n
@ -184,6 +197,7 @@ func (n *Node) Pad() *Node {
n.pad = true
n.changed = true
log.Warn("Pad()", n.WidgetType, n.progname)
// inform the toolkits
sendAction(n, widget.Pad)
return n