diff --git a/redo/controls.go b/redo/controls.go index 3c750cb..bc4f823 100644 --- a/redo/controls.go +++ b/redo/controls.go @@ -15,15 +15,15 @@ type Control interface { type Button interface { Control - // OnClicked sets the event handler for when the Button is clicked. - OnClicked(func(d Doer)) + // OnClicked creates a Request to set the event handler for when the Button is clicked. + OnClicked(func(d Doer)) *Request - // Text and SetText are Requests that get and set the Button's label text. + // Text and SetText creates a Request that get and set the Button's label text. Text() *Request SetText(text string) *Request } -// NewButton returns a Request to create a new Button with the given label text. +// NewButton creates a Request to create a new Button with the given label text. func NewButton(text string) *Request { return newButton(text) } diff --git a/redo/controls_unix.go b/redo/controls_unix.go index 647e5ee..a091488 100644 --- a/redo/controls_unix.go +++ b/redo/controls_unix.go @@ -40,7 +40,10 @@ func newButton(text string) *Request { } } -// TODO OnClicked +func (b *Button) OnClicked(func e(c Doer)) *Request { + // TODO + return nil +} func (b *button) Text() *Request { c := make(chan interface{}) diff --git a/redo/window.go b/redo/window.go index 176239b..27160c2 100644 --- a/redo/window.go +++ b/redo/window.go @@ -22,11 +22,11 @@ type Window interface { // Attempting to use a Window after it has been closed results in undefined behavior. Close() *Request - // OnClosing registers an event handler that is triggered when the user clicks the Window's close button. + // OnClosing creates a Request to register an event handler that is triggered when the user clicks the Window's close button. // On systems where whole applications own windows, OnClosing is also triggered when the user asks to close the application. // If this handler returns true, the Window is closed as defined by Close above. // If this handler returns false, the Window is not closed. - OnClosing(func(c Doer) bool) + OnClosing(func(c Doer) bool) *Request // TODO SetSize (TODO remove?) // TODO Center diff --git a/redo/window_unix.go b/redo/window_unix.go index f76c350..dddcad1 100644 --- a/redo/window_unix.go +++ b/redo/window_unix.go @@ -107,4 +107,7 @@ func (w *window) Close() *Request { } } -// TODO OnClosing +func (w *window) OnClosing(func e(c Doer) bool) *Request { + // TODO + return nil +}