Re: calling superclass size_request method



On Thu, 2007-10-18 at 09:06 +1000, Kevin Ryde wrote:

    GTK_WIDGET_CLASS (my_foo_parent_class)->size_request (widget, requisition);

this corresponds to the Perl idiom of:

        $self->SUPER::size_request($requisition);

but you must be overriding the signal class closure in Perl as well, and
not just connect to the ::size-request signal (I don't know whether
you're already doing this, but it might be a hint)[1].

what you want to achieve, though, is better done by simply forcing the
size of your widget, and its eventual children, to the given requisition
- which is what the parent's implementation is doing anyway.

in fact, if your widget doesn't have any children, you shouldn't be
overriding the size-request signal closure at all.

ciao,
 Emmanuele.

+++

[1] I wrote the equivalent code -- I did not test it, and on the top of
my head I don't remember if Gtk2::Widget allows you to override the size
requisition phase using Universal::SUPER.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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