I am writing a Vala application.And I want some function to be executed on window resize. I tried to rewrite C example with window resizing callback, it seems to be working (compiling, I mean), but when I run my program it segfaults.
Here is my code:
Gtk.Widget toplevel = this.get_toplevel();
Gtk.Window window = (Gtk.Window)toplevel;
....
Signal.connect(window, "size-allocate", (GLib.Callback)this.callback, null);
and the function callback()
is:
private bool callback(Gtk.Widget* window, Gtk.Allocation? a, char * data )
{
resizeAllImages(window->get_allocated_width());
return false;
}
I tried to rewrite this (http://osdir.com/ml/gtk-list/2010-01/msg00092.html) tutorial into Vala, but it looks like I am doing something wrong. Can you help me with it?