Johannes wrote:
place wrote:
In FltkComplexButtonResource::createNewWidget, the button's child is a view. When the button is destroyed, since the button is a Group, its children get destroyed. Later on, the layout is being destroyed, and it deletes TopLevel. The toplevel widget destructor calls layout->removeWidget(), which tries to iterate through the views.
Ok I'm just trying to understand the ComplexButton button stuff - rather good class name btw :-) Why is there a view as child of the button? What is this view supposed to display?
I have no idea whether it's necessary. Maybe the layout in the button doesn't get shown otherwise?
Anyway, first I'd suggest:
diff -r f1f343e2c024 dw/fltkui.cc --- a/dw/fltkui.cc Tue Mar 18 18:05:51 2008 +0100 +++ b/dw/fltkui.cc Wed Mar 26 16:57:13 2008 +0100 @@ -423,13 +423,15 @@ if (!relief) button->box(::fltk::FLAT_BOX);
- button->begin (); lastFlatView = new FltkFlatView (allocation->x + reliefXThickness (), allocation->y + reliefYThickness (), allocation->width - 2 * reliefXThickness (), allocation->ascent + allocation->descent - 2 * reliefYThickness ()); + + button->add (lastFlatView); + if (layout) layout->attachView (lastFlatView); return button;
because this begin () / end () stuff is rather ugly, especially if the matching end () is missing.
Yes! At first, without the end(), I assumed the begin() was extraneous.
Sounds reasonable, but I'd really like to understand that ComplexButton stuff first. Is there something in doc/ I did not see? How did you know it is supposed to be used for image inputs?
In dw/ui.hh, it says * <tr><td>image <td>dw::core::ui::ComplexButtonResource * <td>dw::core::ui::ResourceFactory::createComplexButtonResource, * width a dw::Image inside and relief = false. PS I subscribed to the list under a new address, but my first msg is still awaiting moderator approval, so the old address lives on a bit longer...