blob: e69e2bf13067a1b278337315289d4b7ac4df634d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package gui
// functions to create 'Dropdown' and 'Combobox'
// Combobox is a Dropdown you can edit
// Thererfore, AddDropdownName() is used on both combobox and dropdown nodes
// since it is the same. confusing names? maybe...
import (
"git.wit.org/wit/gui/toolkit"
)
// add a new entry to the dropdown name
func (n *Node) AddDropdownName(name string) {
n.Add(name)
}
// Set the dropdown menu to 'name'
func (n *Node) SetDropdownName(name string) {
n.SetText(name)
}
func (n *Node) NewDropdown(name string) *Node {
newNode := n.New(name, toolkit.Dropdown, nil)
send(n, newNode)
return newNode
}
func (n *Node) NewCombobox(name string) *Node {
newNode := n.New(name, toolkit.Combobox, nil)
send(n, newNode)
return newNode
}
|