From 64d5eb541eb28e1a7e81adca66a72155d16033b4 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 17 Mar 2014 21:09:03 -0400 Subject: Changed the new resizing code so that it uses the same allocated slice per window instead of making a new one to store all the resize requests each time. --- callbacks_unix.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'callbacks_unix.go') diff --git a/callbacks_unix.go b/callbacks_unix.go index 68fb0ef..1efe723 100644 --- a/callbacks_unix.go +++ b/callbacks_unix.go @@ -42,8 +42,9 @@ 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 - resizeList := s.resize(0, 0, width, height) - for _, s := range resizeList { + 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()) -- cgit v1.2.3