diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 21:46:50 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 21:46:50 -0600 |
| commit | 32fe455bb5c75b756ca0ff7e2a5d076a30978db4 (patch) | |
| tree | 252a5e804d86d78a41cdca4f83b460baee71bfb3 /basicDropdown.go | |
| parent | 751b6059c0432ede8de32656b777196cfdd6adaf (diff) | |
now should work without needed to actually displayv0.12.6
a nice improvement. actual toolkit widgets
arent' actually needed. It's faster
and can run in the dark
autotypist compiles and runs
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'basicDropdown.go')
| -rw-r--r-- | basicDropdown.go | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/basicDropdown.go b/basicDropdown.go index 78af8bd..fbc5137 100644 --- a/basicDropdown.go +++ b/basicDropdown.go @@ -30,10 +30,12 @@ type BasicDropdown struct { Custom func() } +/* func (d *BasicDropdown) Get() string { if ! d.Ready() {return ""} return d.d.GetText() } +*/ // Returns true if the status is valid func (d *BasicDropdown) Ready() bool { @@ -41,19 +43,33 @@ func (d *BasicDropdown) Ready() bool { return d.ready } -func (d *BasicDropdown) Add(value string) { +func (d *BasicDropdown) AddText(s string) { if ! d.Ready() {return} - log.Log(INFO, "BasicDropdown.Set() =", value) - d.d.AddDropdownName(value) + log.Log(INFO, "BasicDropdown.AddText() =", s) + d.d.AddText(s) + return +} + +func (d *BasicDropdown) SetText(s string) { + if ! d.Ready() {return} + log.Log(INFO, "BasicDropdown.SetText() =", s) + d.d.SetText(s) return } +func (d *BasicDropdown) String() string { + if ! d.Ready() {return ""} + log.Log(INFO, "BasicDropdown.String()", d.d.String()) + return d.d.String() +} + func (d *BasicDropdown) SetLabel(value string) bool { if ! d.Ready() {return false} log.Log(INFO, "BasicDropdown.SetLabel() =", value) d.l.SetText(value) return true } +/* func (d *BasicDropdown) Set(value string) bool { if ! d.Ready() {return false} log.Log(INFO, "BasicDropdown.Set() =", value) @@ -61,6 +77,7 @@ func (d *BasicDropdown) Set(value string) bool { d.value = value return true } +*/ func NewBasicDropdown(p *gui.Node, name string) *BasicDropdown { d := BasicDropdown { @@ -71,9 +88,9 @@ func NewBasicDropdown(p *gui.Node, name string) *BasicDropdown { // various timeout settings d.l = p.NewLabel(name) - d.d = p.NewDropdown("") + d.d = p.NewDropdown() d.d.Custom = func() { - d.value = d.Get() + d.value = d.d.String() log.Log(INFO, "BasicDropdown.Custom() user changed value to =", d.value) if d.Custom != nil { d.Custom() |
