Deleting a button at runtime - why do I need SetTmpDefaultItem ?

Vadim Zeitlin vadim at wxwidgets.org
Tue Feb 5 07:26:10 PST 2008


On Tue, 5 Feb 2008 16:21:42 +0100 Thibault Genessay <tibogens at gmail.com> wrote:

TG> I have a form (in a dialog) that contains subpanels that can be added
TG> / removed dynamically by the user. Basically, it looks like
TG> Thunderbird's "Edit->Find->Search Messages ..." dialog. When you click
TG> '+' it adds a panel with choices, edit fields and '+' and '-' buttons.
TG> When a '+' button, a new panel is created - this works perfectly.
TG> But when the '-' button is clicked, it detaches the panel from its
TG> sizer and Destroy()s it. Everything is OK up to the point where I
TG> click another button on the dialog - the program crashes.
...
TG> Is this a bug ?

 Yes. But I don't know why does it happen, the button is supposed to unset
itself as (temporary) default button when it's being destroyed. Can you
please try to debug what happens in ~wxButton of your button? If you can't
find it, please try reproducing the bug with the minimal amount of the code
possible and open a bug report about it on SF.

 Thanks,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list