2022-10-21 11:40:08 -05:00
|
|
|
package gui
|
|
|
|
|
2023-03-01 11:35:36 -06:00
|
|
|
import "git.wit.org/wit/gui/toolkit"
|
|
|
|
|
2022-10-21 11:40:08 -05:00
|
|
|
func (n *Node) Checked() bool {
|
2023-03-01 11:35:36 -06:00
|
|
|
return n.widget.B
|
2022-10-21 11:40:08 -05:00
|
|
|
}
|
|
|
|
|
2022-11-13 08:53:03 -06:00
|
|
|
func (n *Node) NewCheckbox(name string) *Node {
|
2023-03-01 11:35:36 -06:00
|
|
|
newNode := n.New(name, toolkit.Checkbox, nil)
|
2023-03-23 12:35:12 -05:00
|
|
|
|
|
|
|
var a toolkit.Action
|
2023-03-29 23:03:04 -05:00
|
|
|
a.ActionType = toolkit.Add
|
|
|
|
a.Name = name
|
|
|
|
a.Text = name
|
2023-03-23 12:35:12 -05:00
|
|
|
newaction(&a, newNode, n)
|
|
|
|
|
2023-03-01 11:35:36 -06:00
|
|
|
return newNode
|
|
|
|
}
|