diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-16 18:04:57 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-16 18:04:57 -0500 |
| commit | 622d7b15696d50767737e5d5621c647a818b91b9 (patch) | |
| tree | b59a63be7215a25e48456b7e025cca9f50784ce8 /sysdata_unix.go | |
| parent | 7c365b39205310d042d17fcb0825e84ee19477a5 (diff) | |
Added window (and thus control) resizing. Other bugs have been fixed along the way.
Diffstat (limited to 'sysdata_unix.go')
| -rw-r--r-- | sysdata_unix.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sysdata_unix.go b/sysdata_unix.go index dfe3a8c..6f9e001 100644 --- a/sysdata_unix.go +++ b/sysdata_unix.go @@ -35,6 +35,19 @@ var classTypes = [nctypes]*classData{ return true // do not close the window } }, + "configure-event": func(w *sysData) func() bool { + return func() bool { + if w.container != nil && w.resize != nil { // wait for init + width, height := gtk_window_get_size(w.widget) + // run in another goroutine since this will be called in uitask + go func() { + w.resize(0, 0, width, height) + }() + } + // TODO really return true? + return true // do not continue events; we just did so + } + }, }, }, c_button: &classData{ @@ -80,6 +93,7 @@ println(s.widget) uitask <- func() { fixed := gtk_fixed_new() gtk_container_add(s.widget, fixed) + // TODO return the container before assigning the signals? for signal, generator := range ct.signals { g_signal_connect(s.widget, signal, generator(s)) } @@ -139,6 +153,7 @@ if classTypes[s.ctype] == nil || classTypes[s.ctype].setText == nil { return nil } func (s *sysData) setRect(x int, y int, width int, height int) error { +if classTypes[s.ctype] == nil || classTypes[s.ctype].setText == nil { return nil } ret := make(chan struct{}) defer close(ret) uitask <- func() { |
