diff options
| author | Jeff Carr <[email protected]> | 2024-01-01 16:11:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-01 16:11:54 -0600 |
| commit | 36218f4535dd65d2c8d4ecbea761b3b0289e6f3c (patch) | |
| tree | 24cf9c64dd518528f30a6282e879e8e5c6136bd4 /gocui/checkbox.go | |
move into seperate repo
Diffstat (limited to 'gocui/checkbox.go')
| -rw-r--r-- | gocui/checkbox.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gocui/checkbox.go b/gocui/checkbox.go new file mode 100644 index 0000000..d8c6f4b --- /dev/null +++ b/gocui/checkbox.go @@ -0,0 +1,33 @@ +package main + +import ( +// "github.com/awesome-gocui/gocui" + "go.wit.com/gui/gui/toolkit" +) + +func (n *node) setCheckbox(b bool) { + w := n.tk + if (n.WidgetType != toolkit.Checkbox) { + return + } + if (b) { + n.B = b + n.Text = "X " + n.Name + } else { + n.B = b + n.Text = " " + n.Name + } + 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 + +// if w.frame { +// w.realWidth += me.FramePadW +// w.realHeight += me.FramePadH +// } + + n.deleteView() + n.showView() +} |
