Okay, I added size_request()
I can't say exactly what 'gtk_widget_size_request' is supposed to do[1], but I don't think it really related to what I was asking about, the current size of a widget.
and size_allocate().
The docs for 'gtk_widget_size_allocate'[2] are a bit more clear:
"This function is only used by GtkContainer subclasses, to assign a size and position to their child widgets."
I was thinking more in the line of what is implemented in the (old) GTK module, adding a allocation() method in gtkwidget.pre:
mapping(string:int) allocation() //! Returns ([ "x":xoffset, "y":yoffset, "width":xsize, "height":ysize ]) { pgtk_verify_inited(); push_text( "x" ); push_int( GTK_WIDGET( THIS->obj )->allocation.x ); push_text( "y" ); push_int( GTK_WIDGET( THIS->obj )->allocation.y ); push_text( "width" ); push_int( GTK_WIDGET( THIS->obj )->allocation.width ); push_text( "height" ); push_int( GTK_WIDGET( THIS->obj )->allocation.height ); f_aggregate_mapping( 8 ); }
But as marcus points out, it is not strictly necessary.
[1] URL:http://developer.gimp.org/api/2.0/gtk/GtkWidget.html#gtk-widget-size-request [2] URL:http://developer.gimp.org/api/2.0/gtk/GtkWidget.html#gtk-widget-size-allocate