diff options
| author | Jeff Carr <[email protected]> | 2024-01-19 05:54:55 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-19 05:54:55 -0600 |
| commit | f7bb1084ca117315fc293d077a8e4e24ccfe7cd8 (patch) | |
| tree | f69a69fc5d63b0f5de7535fc79794c0e4341c953 | |
| parent | c682272f56094fc816c6b7fbee84351f5608c259 (diff) | |
builds and remembers Visable
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | action.go | 10 | ||||
| -rw-r--r-- | common.go | 2 | ||||
| -rw-r--r-- | node.go | 3 | ||||
| -rw-r--r-- | structs.go | 7 | ||||
| -rw-r--r-- | window.go | 1 |
5 files changed, 21 insertions, 2 deletions
@@ -27,7 +27,7 @@ func sendAction(n *Node, atype widget.ActionType) { } n.mu.Lock() defer n.mu.Unlock() - log.Warn("SENDING ACTION STRINGS n.Strings", n.strings) + log.Warn("SENDING ACTION STRINGS n.Strings", n.strings, n.id, n.WidgetType, n.GetProgName()) // if the widget is hidden, don't send actions to the plugin if n.hidden { @@ -50,7 +50,13 @@ func sendAction(n *Node, atype widget.ActionType) { a.State.ProgName = n.progname a.State.Label = n.label a.State.Value = n.value + a.State.Checked = n.checked + a.State.Visable = n.visable + a.State.Pad = n.pad + a.State.Expand = n.expand + a.State.Borderless = n.borderless + a.State.Direction = n.direction for s, _ := range n.strings { a.State.Strings = append(a.State.Strings, s) @@ -80,7 +86,7 @@ func sendAction(n *Node, atype widget.ActionType) { // sends the action/event to each toolkit via a golang plugin channel func sendActionToPlugin(a *widget.Action) { for _, aplug := range allPlugins { - log.Log(PLUG, "Action() aplug =", aplug.name, "Action type=", a.ActionType) + log.Warn("send to toolkit =", aplug.name, "Action type=", a.ActionType, a.WidgetId) if aplug.pluginChan == nil { log.Warn("Action() retrieving the aplug.PluginChannel()", aplug.name) aplug.pluginChan = aplug.PluginChannel() @@ -17,6 +17,7 @@ func (n *Node) Show() *Node { return n } + n.visable = true n.hidden = false n.changed = true @@ -51,6 +52,7 @@ func (n *Node) Hide() *Node { return nil } + n.visable = false n.hidden = true n.changed = true @@ -25,7 +25,10 @@ func (n *Node) newNode(title string, t widget.WidgetType) *Node { // set these defaults newN.expand = true + newN.visable = true newN.pad = true + newN.borderless = false + newN.enabled = true newN.changed = true @@ -114,6 +114,13 @@ type Node struct { // for widgets that have on/off things checked bool + // tells the toolkits if the user should currently see it + // state updates are only sent to the toolkits for visable widgets + visable bool + + // borderless windows + borderless bool + // this function is run when there are mouse or keyboard events Custom func() @@ -18,6 +18,7 @@ func (parent *Node) NewWindow(title string) *Node { newNode.progname = title newNode.label = title newNode.value = title + newNode.margin = true // inform the toolkits sendAction(newNode, widget.Add) |
