summaryrefslogtreecommitdiff
path: root/main_test.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-25 00:48:23 -0500
committerPietro Gagliardi <[email protected]>2014-02-25 00:49:08 -0500
commitd8c0df79939c93bbe008049b84ea6f8ff85afe8b (patch)
tree79fa3aab8f14366b2cd571ea8c9d7c2f5e1dd4e1 /main_test.go
parent23a40cae26552a381a25cd862af98cd0e9aa23bf (diff)
Added GTK+ implementation of ProgressBar and added a ProgressBar to the test program.
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/main_test.go b/main_test.go
index 3917fef..c778d2a 100644
--- a/main_test.go
+++ b/main_test.go
@@ -21,7 +21,12 @@ func TestMain(t *testing.T) {
s3 := NewStack(Horizontal, l, b3)
s3.SetStretchy(0)
// s3.SetStretchy(1)
- s0 := NewStack(Vertical, s2, c, cb1, cb2, e, s3)
+ pbar := NewProgressBar()
+ prog := 0
+ incButton := NewButton("Inc")
+ decButton := NewButton("Dec")
+ sincdec := NewStack(Horizontal, incButton, decButton)
+ s0 := NewStack(Vertical, s2, c, cb1, cb2, e, s3, pbar, sincdec)
lb1 := NewListbox(true, "Select One", "Or More", "To Continue")
lb2 := NewListbox(false, "Select", "Only", "One", "Please")
i := 0
@@ -71,8 +76,19 @@ mainloop:
cb2.SelectedIndex(), cb2.Selection(),
lb1.SelectedIndices(), lb1.Selection(),
lb2.SelectedIndices(), lb2.Selection())
+ case <-incButton.Clicked:
+ prog++
+ if prog > 100 {
+ prog = 100
+ }
+ pbar.SetProgress(prog)
+ case <-decButton.Clicked:
+ prog--
+ if prog < 0 {
+ prog = 0
+ }
+ pbar.SetProgress(prog)
}
}
w.Hide()
}
-