diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-19 09:44:32 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-19 09:44:32 -0400 |
| commit | 48c5055eb960d6db3d3b997bdc859670f473a277 (patch) | |
| tree | ebde497dc011e9c1a8dca63710e59fb9e2b75c69 /redo/controls.go | |
| parent | 47c0f573a986622a1968cf324fb1c5c5881a63a5 (diff) | |
Started dropping the whole request/response system because it fell apart... time to make a ui.Do(func(){ ... })
Diffstat (limited to 'redo/controls.go')
| -rw-r--r-- | redo/controls.go | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/redo/controls.go b/redo/controls.go index e8610a5..3fb2a54 100644 --- a/redo/controls.go +++ b/redo/controls.go @@ -16,24 +16,15 @@ type Control interface { type Button interface { Control - // OnClicked creates a Request to set the event handler for when the Button is clicked. - OnClicked(func(d Doer)) *Request + // OnClicked sets the event handler for when the Button is clicked. + OnClicked(func()) - // Text and SetText creates a Request that get and set the Button's label text. - Text() *Request - SetText(text string) *Request + // Text and SetText get and set the Button's label text. + Text() string + SetText(text string) } -// NewButton creates a Request to create a new Button with the given label text. -func NewButton(text string) *Request { +// NewButton creates a new Button with the given label text. +func NewButton(text string) { return newButton(text) } - -// GetNewButton is like NewButton but sends the Request along the given Doer and returns the resultant Button. -// Example: -// b := ui.GetNewButton(ui.Do, "OK") -func GetNewButton(c Doer, text string) Button { - req := newButton(text) - c <- req - return (<-req.resp).(Button) -} |
