On Thu, Mar 20, 2008 at 03:12:15PM +0000, place wrote:
For you dw people... I am working on getting ComplexButton to work (image inputs),
Great!
and it would segfault when I'd close the bw.
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? 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.
To make the problem go away, I added: fltkcomplexbutton.hh: ~ComplexButton() {remove_all();} but I don't know any of this code well enough to know what _should_ be going on.
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? Cheers, Johannes