diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-07 15:30:55 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-07 15:30:55 -0400 |
| commit | c0c38ac8f5ded52f0db925ca7ca4bc6efedcb648 (patch) | |
| tree | dfd26c04614de99081742446f422559fc9d3f289 /redo/controls_unix.go | |
| parent | 7966d7023015ba3ec5e0ed3c3e5682651b5b33fb (diff) | |
Added the GTK+ implementation of Window, added the Window constructors, and rewrote the GTK+ Button constructor to use Requests.
Diffstat (limited to 'redo/controls_unix.go')
| -rw-r--r-- | redo/controls_unix.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/redo/controls_unix.go b/redo/controls_unix.go index 1fc76c0..647e5ee 100644 --- a/redo/controls_unix.go +++ b/redo/controls_unix.go @@ -24,13 +24,19 @@ type button struct { button *C.GtkButton } -func newButton(text string) Button { - ctext := togstr(text) - defer freegstr(ctext) - widget := C.gtk_button_new_with_label(ctext) - return &button{ - widget: newWidget(widget), - button: (*C.GtkButton)(unsafe.Pointer(widget)), +func newButton(text string) *Request { + c := make(chan interface{}) + return &Request{ + op: func() { + ctext := togstr(text) + defer freegstr(ctext) + widget := C.gtk_button_new_with_label(ctext) + c <- &button{ + widget: newWidget(widget), + button: (*C.GtkButton)(unsafe.Pointer(widget)), + } + }, + resp: c, } } |
