[wxpython-users] Grid crash when capture focus

Oswaldo Hernández listas at soft-com.es
Thu Mar 27 01:43:05 PDT 2008


Robin Dunn escribió:
> Oswaldo Hernández wrote:
>> Hello,
>>
>> If capture grid EVT_SET_FOCUS, and make some grid operation in the 
>> event, python crash if close the Frame when you are editing a cell.
>>
>> I attatch a sample:
>>
>> . Run it,
>> . Enter to edit any cell,
>> . When are editing the cell click on 'x' button to close the frame
>>
> 
> You can probably use something like this to prevent the event handler 
> from doing anything if it is in the process of being destroyed:
> 
>     if self.GetTopLevelParent().IsBeingDeleted():
>         return
> 


self.GetTopLevelParent() returns None if the frame is closing,

if not self.GetTopLevelParent() or self.GetTopLevelParent().IsBeingDeleted():
     return

works fine.

Thanks


-- 
*****************************************
Oswaldo Hernández
oswaldo (@) soft-com (.) es
*****************************************
PD:
Antes de imprimir este mensaje, asegúrese de que es necesario.
El medio ambiente está en nuestra mano.


More information about the wxpython-users mailing list