Sebastián E. Peyrott <as7cf <at> yahoo.com> writes: > > Murray Cumming <murrayc <at> murrayc.com> writes: > > > > > On Sun, 2006-10-22 at 06:22 +0000, Sebastián E.Peyrott wrote: > > [snip] > > > Whenever the app calls ScrolledWindow::remove() under > > > Windows (XP, gtk/gtkmm 2.8), it crashes. This behaviour is not seen > > > under > > > Linux. The contained widgets are Gtk::Layouts, and none of them are > > > managed. > > > The only difference between the Linux build and the Windows build are > > > the > > > headers and libraries used to build the executable. For Linux I'm > > > using > > > gtk/gtkmm-2.8, while for Windows, gtk/gtkmm-2.6 > > [snip] > > > > There was a bug in gtkmm 2.6 that caused managed child widgets to be > > destroyed when remove()ed from their parents. You could #ifdef for 2.6 > > and add the necessary extra child.reference() to work around that bug. > > Just make sure that you don't do the extra reference with 2.8. > > > > But it would be better to upgrade to gtkmm 2.8 or 2.10 for all > > platforms. > > > Thanks for the quick response =). Well, I thought it'd be possible there was a > bug in ScrolledWindow that caused the unexpected deletion of its children, but, > as I said before, none of the contained widgets are actually managed. In any > case, it does seem the child widget is getting destroyed (somehow, somewhere), > since whenever I try to access any of its member functions I get a segfault. As > a result, I cannot make a call to children->reference() before trying to remove > it from the ScrolledWindow. This behaviour is also very strange, since the > widgets are actually displayed in the ScrolledWindow and respond to user input > which would seem to imply they were not destroyed (??). > I'll make them managed to see if there is any difference. > > I'd like to upgrade to gtkmm-2.8 but I need to keep compatibility with Windows > 98, and, AFAIK you cannot use it there. > > _______________________________________________ > gtkmm-list mailing list > gtkmm-list <at> gnome.org > http://mail.gnome.org/mailman/listinfo/gtkmm-list >
OK, as a followup, I can confirm this also happens when building against gtkmm-2.8 for Windows, so it cannot be related to the aforementioned bug. I can also confirm it only happens when trying to remove() widgets from my derived classes (DeviceLayout : public Gtk::Layout), so I MUST be doing something wrong, I just cannot figure out what exactly. When removing standard widgets (Gtk::Layout) this doesn't happen. Is there any virtual function I should have overriden in my derived classes? (And even in that case, it should not fail, as ScrolledWindow keeps a reference to a Gtk::Widget?). I'm deriving widgets from Gtk::Layout. _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
