summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/combobox.go
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/andlabs/combobox.go')
-rw-r--r--toolkit/andlabs/combobox.go54
1 files changed, 6 insertions, 48 deletions
diff --git a/toolkit/andlabs/combobox.go b/toolkit/andlabs/combobox.go
index 3395406..e200b3b 100644
--- a/toolkit/andlabs/combobox.go
+++ b/toolkit/andlabs/combobox.go
@@ -10,15 +10,10 @@ func (t *andlabsT) newCombobox(w *toolkit.Widget) *andlabsT {
var newt andlabsT
log(debugToolkit, "newCombobox() START", w.Name)
- if t.broken() {
- return nil
- }
-
newt.tw = w
s := ui.NewEditableCombobox()
newt.uiEditableCombobox = s
- newt.uiBox = t.uiBox
- t.uiBox.Append(s, stretchy)
+ newt.uiControl = s
// initialize the index
newt.c = 0
@@ -46,7 +41,9 @@ func (t *andlabsT) AddComboboxName(title string) {
t.c = t.c + 1
}
-func newCombobox(parentW *toolkit.Widget, w *toolkit.Widget) {
+func newCombobox(a *toolkit.Action) {
+ w := a.Widget
+ parentW := a.Where
log(debugToolkit, "newCombobox()", w.Name)
t := mapToolkits[parentW]
@@ -56,45 +53,6 @@ func newCombobox(parentW *toolkit.Widget, w *toolkit.Widget) {
return
}
newt := t.newCombobox(w)
- mapWidgetsToolkits(w, newt)
-}
-
-func doCombobox(p *toolkit.Widget, c *toolkit.Widget) {
- if broken(c) {
- return
- }
- if (c.Action == "New") {
- newCombobox(p, c)
- return
- }
- ct := mapToolkits[c]
- if (ct == nil) {
- log(true, "Trying to do something on a widget that doesn't work or doesn't exist or something", c)
- return
- }
- if ct.broken() {
- log(true, "Combobox() ct.broken", ct)
- return
- }
- if (ct.uiEditableCombobox == nil) {
- log(true, "Combobox() uiEditableCombobox == nil", ct)
- return
- }
- log(debugChange, "Going to attempt:", c.Action)
- switch c.Action {
- case "Add":
- ct.AddComboboxName(c.S)
- case "Enable":
- ct.uiEditableCombobox.Enable()
- case "Disable":
- ct.uiEditableCombobox.Disable()
- case "Show":
- ct.uiEditableCombobox.Show()
- case "Hide":
- ct.uiEditableCombobox.Hide()
- case "Set":
- ct.uiEditableCombobox.SetText(c.S)
- default:
- log(debugError, "Can't do", c.Action, "to a Combobox")
- }
+ place(a, t, newt)
+ mapWidgetsToolkits(a, newt)
}