[wxPython-users] Deleting a text control from an EVT_TEXT_ENTER

Anthony M. Floyd Anthony.Floyd at convergent.ca
Wed Jul 18 09:54:25 PDT 2007


Hi Werner,

[snip]

>    def DestroyTextCtrl(self, control):
>         sizer = control.GetContainingSizer()
>         if sizer:
>             sizer.Detach(control)
>         wx.CallAfter(control.Destroy)

Thanks, yes that does work too.  Of course, when I tried to implement
it, it was still crashing, but that's when I noticed that the callback
was control.Destroy and not control.Destroy().  When using the
unbracketed case, I don't need to detach it from the sizer before
destroying it.

Thanks,
Anthony.





More information about the wxpython-users mailing list