diff options
| author | Jeff Carr <[email protected]> | 2023-12-02 19:02:51 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-02 19:02:51 -0600 |
| commit | 7880d9df6de1040258bea966f040e12be6205af1 (patch) | |
| tree | bb0f3d74eb4e3b5094bfe78e936679efb940cacf /toolkit/gocui/checkbox.go | |
| parent | 19e6ea76f3c09fe3a5d9a4d4caff7d14571f4ba5 (diff) | |
gocui plugin refactor to a *node binary tree
rename arg '--gui <toolkit>'
add a cloudflare example
fixes since go v1.21 didn't compile anymore due to argv order
more place() changes
recursive size computation
gocui: Major refactor to use the *node binary tree
gocui: refactor place() and size()
gocui: better place() and spacing (tab, buttons, etc)
gocui: better mouse click handling
gocui: switch to using tk.gocuiSize & tk.size
gocui: event handling cleanups
gocui: add window labels work
gocui: struct cleanups
gocui: duplicate binary tree structs removed
gocui: deprecate old children
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/checkbox.go')
| -rw-r--r-- | toolkit/gocui/checkbox.go | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/toolkit/gocui/checkbox.go b/toolkit/gocui/checkbox.go index 5568ee3..a1fe27c 100644 --- a/toolkit/gocui/checkbox.go +++ b/toolkit/gocui/checkbox.go @@ -5,28 +5,29 @@ import ( "git.wit.org/wit/gui/toolkit" ) -func (w *cuiWidget) setCheckbox(b bool) { - if (w.widgetType != toolkit.Checkbox) { +func (n *node) setCheckbox(b bool) { + w := n.tk + if (n.WidgetType != toolkit.Checkbox) { return } if (b) { - w.b = b - w.text = "X " + w.name + n.B = b + n.Text = "X " + n.Name } else { - w.b = b - w.text = " " + w.name + n.B = b + n.Text = " " + n.Name } - t := len(w.text) + 1 + t := len(n.Text) + 1 w.gocuiSize.w1 = w.gocuiSize.w0 + t - w.realWidth = w.gocuiSize.Width() + me.PadW - w.realHeight = w.gocuiSize.Height() + me.PadH +// w.realWidth = w.gocuiSize.Width() + me.PadW +// w.realHeight = w.gocuiSize.Height() + me.PadH - if w.frame { - w.realWidth += me.FramePadW - w.realHeight += me.FramePadH - } +// if w.frame { +// w.realWidth += me.FramePadW +// w.realHeight += me.FramePadH +// } - w.deleteView() - w.showView() + n.deleteView() + n.showView() } |
