diff options
| author | Pietro Gagliardi <[email protected]> | 2014-11-04 08:48:36 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-11-04 08:48:36 -0500 |
| commit | 47600ec08712b6bebeea65270be7067f7bc56882 (patch) | |
| tree | 66ffbf7d77803fd203734772678de60638fb043f /basicctrls.go | |
| parent | 4333a1221bf10979852754198b765f5697fe3de4 (diff) | |
Added ProgressBar and implemented it on GTK+.
Diffstat (limited to 'basicctrls.go')
| -rw-r--r-- | basicctrls.go | 17 |
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() +} |
