summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-14 12:16:27 -0500
committerPietro Gagliardi <[email protected]>2014-02-14 12:16:27 -0500
commit39442cefebe21b33e7796ffcf9687a8af34c5a20 (patch)
tree2bd82d16545940a404192996136d2dc4f25108b5 /main.go
parent9403224eb0842c680f60541190ab32d571a545da (diff)
Added Combobox.
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/main.go b/main.go
index beb2f0e..81e48fa 100644
--- a/main.go
+++ b/main.go
@@ -10,7 +10,9 @@ func main() {
w.Closing = make(chan struct{})
b := NewButton("Click Me")
c := NewCheckbox("Check Me")
- s := NewStack(Vertical, b, c)
+ cb1 := NewCombobox(true, "You can edit me!", "Yes you can!", "Yes you will!")
+ cb2 := NewCombobox(false, "You can't edit me!", "No you can't!", "No you won't!")
+ s := NewStack(Vertical, b, c, cb1, cb2)
err := w.Open(s)
if err != nil {
panic(err)
@@ -22,7 +24,15 @@ mainloop:
case <-w.Closing:
break mainloop
case <-b.Clicked:
- err := w.SetTitle(fmt.Sprintf("Check State: %v", c.Checked()))
+ cs1, err := cb1.Selection()
+ if err != nil {
+ panic(err)
+ }
+ cs2, err := cb2.Selection()
+ if err != nil {
+ panic(err)
+ }
+ err = w.SetTitle(fmt.Sprintf("%v | %s | %s", c.Checked(), cs1, cs2))
if err != nil {
panic(err)
}