Deleting a button at runtime - why do I need
SetTmpDefaultItem ?
Thibault Genessay
tibogens at gmail.com
Tue Feb 5 23:07:17 PST 2008
On Feb 6, 2008 1:37 AM, Vadim Zeitlin <vadim at wxwidgets.org> wrote:
> On Tue, 5 Feb 2008 16:41:11 +0100 Thibault Genessay <tibogens at gmail.com> wrote:
>
> TG> In ~wxButton(), it effectively tries to unset itself as its parent top
> TG> window's default item, but fails to do so
> TG> (in wxButton::UnsetTmpDefault()) because the
> TG> GetTLWParentIfNotBeingDeleted() returns NULL. Actually, given the
> TG> description of this method, this behavior seems okay, because the
> TG> window is being deleted.
>
> The name is not very clear, it should only return NULL if TLW parent is
> being deleted, not wxButton itself.
>
> TG> What seems to trick the button is that its parent (the subpanel) is
> TG> being deleted, while the TLW that contains it is not, so the search
>
> This patch should help then, could you please test it?
Vadim, you rock :) It works now.
I think you can commit the patch to SVN.
Thanks for the quick fix
Cheers
Thibault
More information about the wx-users
mailing list