summaryrefslogtreecommitdiff
path: root/basicctrls.go
diff options
context:
space:
mode:
Diffstat (limited to 'basicctrls.go')
-rw-r--r--basicctrls.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/basicctrls.go b/basicctrls.go
index bd82849..dbe9190 100644
--- a/basicctrls.go
+++ b/basicctrls.go
@@ -147,7 +147,6 @@ func NewTextbox() Textbox {
// - TODO set page step?
// - TODO wrapping
// - TODO negative values
-// - TODO ensuring values entered in text box stay within bounds (OS X seems to take care of this automatically; not sure about Windows or GTK+...)
type Spinbox interface {
Control
@@ -170,3 +169,19 @@ func NewSpinbox(min int, max int) Spinbox {
}
return newSpinbox(min, max)
}
+
+// ProgressBar is a Control that displays a horizontal bar which shows the level of completion of an operation.
+type ProgressBar interface {
+ Control
+
+ // Percent and SetPrecent get and set the current percentage indicated by the ProgressBar, respectively.
+ // This value must be between 0 and 100; all other values cause SetPercent to panic.
+ Percent() int
+ SetPercent(percent int)
+}
+
+// NewProgressBar creates a new ProgressBar.
+// It will initially show a progress of 0%.
+func NewProgressBar() ProgressBar {
+ return newProgressBar()
+}