From 7c96841392d64e611d1d99f1c5a241b92e95f4d3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 31 Oct 2014 19:57:48 -0400 Subject: Added Spinbox.OnChanged() and implemented it on GTK+ and Mac OS X. Implementing it on Windows is going to be a pain... --- basicctrls.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'basicctrls.go') diff --git a/basicctrls.go b/basicctrls.go index 8e4e926..82caada 100644 --- a/basicctrls.go +++ b/basicctrls.go @@ -146,7 +146,6 @@ func NewTextbox() Textbox { // - TODO set increment? (work on windows) // - TODO set page step? // - TODO wrapping -// - TODO set/get integer value // - TODO negative values // - TODO ensuring values entered in text box stay within bounds type Spinbox interface { @@ -156,6 +155,10 @@ type Spinbox interface { // For SetValue, if the new value is outside the current range of the Spinbox, it is set to the nearest extremity. Value() int SetValue(value int) + + // OnChanged sets the event handler for when the Spinbox's value is changed. + // Under what conditions this event is raised when the user types into the Spinbox's edit field is platform-defined. + OnChanged(func()) } // NewSpinbox creates a new Spinbox with the given minimum and maximum. -- cgit v1.2.3