From 3c25b58652b55ee27a8c3c1f09e88a1eb593ca39 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 15 Feb 2014 17:59:12 -0500 Subject: Added Listbox.Append() and Listbox.InsertBefore(). --- main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 3e87fd1..ce773ed 100644 --- a/main.go +++ b/main.go @@ -12,18 +12,20 @@ func main() { c := NewCheckbox("Check Me") 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!") + e := NewLineEdit("Enter text here too") + l := NewLabel("This is a label") + s0 := NewStack(Vertical, b, c, cb1, cb2, e, l) + lb := NewListbox(true, "Select One", "Or More", "To Continue") + lb2 := NewListbox(false, "Select", "Only", "One", "Please") i := 0 doAdjustments := func() { cb1.Append("append") cb2.InsertBefore(fmt.Sprintf("before %d", i), 1) + lb.InsertBefore(fmt.Sprintf("%d", i), 2) + lb2.Append("Please") i++ } doAdjustments() - e := NewLineEdit("Enter text here too") - l := NewLabel("This is a label") - s0 := NewStack(Vertical, b, c, cb1, cb2, e, l) - lb := NewListbox(true, "Select One", "Or More", "To Continue") - lb2 := NewListbox(false, "Select", "Only", "One", "Please") s1 := NewStack(Vertical, lb2, lb) s := NewStack(Horizontal, s1, s0) err := w.Open(s) -- cgit v1.2.3