summaryrefslogtreecommitdiff
path: root/callbacks_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-17 20:42:36 -0400
committerPietro Gagliardi <[email protected]>2014-03-17 20:42:36 -0400
commit19227080da161bc96e4cc8ed447059cefbca8a6a (patch)
tree818f4d443f469ee962268449d86ca406a7399514 /callbacks_unix.go
parentc078266c6d091610eb3acddd68090ee697142315 (diff)
Changed window resizes so that the actual Control.setRect() functions appended to an array of requests that the resize() function set all at once instead of having each done individually. This will be necessary for what I think will be a solution to the deadlocks. It doesn't work right now; I'm assuming it's allocating too much memory. I know how to fix this, but I'm committing what I have so far to be safe.
Diffstat (limited to 'callbacks_unix.go')
-rw-r--r--callbacks_unix.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/callbacks_unix.go b/callbacks_unix.go
index 85eec5a..68fb0ef 100644
--- a/callbacks_unix.go
+++ b/callbacks_unix.go
@@ -42,9 +42,12 @@ 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
- err := s.resize(0, 0, width, height, 0)
- if err != nil {
- panic("child resize failed: " + err.Error())
+ resizeList := s.resize(0, 0, width, height)
+ for _, s := range resizeList {
+ err := s.sysData.setRect(s.x, s.y, s.width, s.height, 0)
+ if err != nil {
+ panic("child resize failed: " + err.Error())
+ }
}
}
// 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