[PATCH] adding gtk_widget_size_request



Hi,

I was using gtk_widget_size_request in gtk2-perl-inline. Any
reason why it has not been implemented, except maybe lack of time
and/or lack of interest? Documentation says it's "typically" used
when implementing a GtkContainer subclass, but I guess that's not
exclusive.. as for myself, I need it to know the preferred size
of two widgets before calling gtk_window_set_default_size
(workarounding GtkScrolledWindow's default size madness).

A possible implementation (against 0.90 - I've checked 0.92 for
presence of this function, though) follows (tested).

--- ./xs/GtkWidget.xs.gege      2003-08-04 15:48:28.000000000 +0200
+++ ./xs/GtkWidget.xs   2003-08-06 16:22:18.000000000 +0200
@@ -464,6 +464,17 @@
        XPUSHs (sv_2mortal (newSViv (width)));
        XPUSHs (sv_2mortal (newSViv (height)));
 
+GtkRequisition_copy *
+gtk_widget_size_request (widget)
+       GtkWidget * widget
+    PREINIT:
+       GtkRequisition req;
+    CODE:
+       gtk_widget_size_request (widget, &req);
+       RETVAL = &req;
+    OUTPUT:
+       RETVAL
+
 void
 gtk_widget_set_events (widget, events)
        GtkWidget              *widget

Thanks.

-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]