From 2d97a2446304daa1d57121d13143cce2ceaf69a3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 15 Feb 2014 18:27:34 -0500 Subject: Added Combobox.SelectedIndex(). --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 49ff4f1..c110e99 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,9 @@ func main() { cb2 := NewCombobox(false, "You can't edit me!", "No you can't!", "No you won't!") e := NewLineEdit("Enter text here too") l := NewLabel("This is a label") - s0 := NewStack(Vertical, s2, c, cb1, cb2, e, l) + b3 := NewButton("List Info") + s3 := NewStack(Horizontal, l, b3) + s0 := NewStack(Vertical, s2, c, cb1, cb2, e, s3) lb := NewListbox(true, "Select One", "Or More", "To Continue") lb2 := NewListbox(false, "Select", "Only", "One", "Please") i := 0 @@ -55,6 +57,11 @@ mainloop: cb2.Delete(2) lb.Delete(3) lb2.Delete(4) + case <-b3.Clicked: + MsgBox("List Info", + "cb1: %d %q\ncb2: %d %q", + cb1.SelectedIndex(), cb1.Selection(), + cb2.SelectedIndex(), cb2.Selection()) } } w.Hide() -- cgit v1.2.3