summaryrefslogtreecommitdiff
path: root/callbacks_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-07 14:32:25 -0400
committerPietro Gagliardi <[email protected]>2014-04-07 14:32:25 -0400
commit3bf215ae4edb616c14c4525638cf54425d6e8f36 (patch)
tree3c253a36643b8ab6891545c217d9af906efc3358 /callbacks_unix.go
parent00acf74177e520c2f961fb478e7674d24c9077c9 (diff)
Split out the common resizing code into its own function so that it's all in one place. This will also affect what happens if I switch to DeferWindowPos() on Windows.
Diffstat (limited to 'callbacks_unix.go')
-rw-r--r--callbacks_unix.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/callbacks_unix.go b/callbacks_unix.go
index e34db4c..fde05ce 100644
--- a/callbacks_unix.go
+++ b/callbacks_unix.go
@@ -41,14 +41,7 @@ func our_window_configure_event_callback(widget *C.GtkWidget, event *C.GdkEvent,
if s.container != nil && s.resize != nil { // wait for init
width, height := gtk_window_get_size(s.widget)
// top-left is (0,0) so no need for winheight
- s.resizes = s.resizes[0:0] // set len to 0 without changing cap
- s.resize(0, 0, width, height, &s.resizes)
- for _, s := range s.resizes {
- err := s.sysData.setRect(s.x, s.y, s.width, s.height, 0)
- if err != nil {
- panic("child resize failed: " + err.Error())
- }
- }
+ s.doResize(0, 0, width, height, 0)
}
// returning false indicates that we continue processing events related to configure-event; if we choose not to, then after some controls have been added, the layout fails completely and everything stays in the starting position/size
// TODO make sure this is the case