Re: Strange bug while subclassing Gtk2::Box



muppet wrote  on 10/30/2005 11:06 PM:
... 8< ...
What versions of gtk+ and Gtk2?

Works on:
archlinux gtk+ 2.8.6 gtk2-perl 1.101 (my default system)

Doesn't work on:
Gentoo gtk+ 2.4.14 gtk2-perl 1.101 (my debug system)
Minislack gtk+ 2.4.0  gtk2-perl 1.082 (James Muir)
Debian, gtk+ 2.6.1 gtk2-perl 1.081 (Eduardo M KALINOWSKI)

+ your results for gtk+ 2.6.10 versus 2.8.2

Compiling this list I think I talked to quick when I said it wasn't a
version difference. As it appears to me the bug shows with gtk versions
< 2.8.x

... 8< ...
I instrumented your code with some calls to Glib::Object::signal_add_emission_hook() (from Glib 1.10x), ran the code in both sandboxes, and compared the output. For some reason, the older gtk+ (which doesn't show the buttons) does not propagate expose events to the HBox's children, but gtk+ 2.8 does.

Making your MyBox derive from HBox and disabling your do_size_allocate () results in a working example on both versions. You probably want to compare your do_size_allocate() with gtk_hbox_size_allocate() and see what you're doing differently.

Yes, I checked gtkhbox.c already. (I also looked at the gtkpathbar.c which is used for the filechooser widget for some hard coded details like the size of the slider buttons :S ). The thing is, there is nothing there; they just calculate the size that needs to be allocated to each button and then call size_allocate() on the buttons. I diff'ed gtkhbox.c from version 2.4.14 to 2.8.6 but there are practically no difference. Parent classes gtkcontainer and gtkbox show some differences, but mainly typos, nothing significant.

I tried calling Gtk2::Container::propagate_expose() on the expose_event for my box class but that didn't help. I'll try more of these kind of things at random :(

-- Jaap <pardus cpan org>





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