PyDeadObjectError(self.attrStr % self._name) ?

Jorgen Bodde jorgen.maillist at gmail.com
Fri Feb 16 10:43:13 PST 2007


Hi guys,

I am pretty new to wxPython, but there is something I do not
understand. This is the code I am using to create a dialog;

    def OnBackupItem(self, event): # wxGlade: ArchivisionFrm.<event_handler>
        dlg = ar_dlg.ArchiverDlg(self, -1)
        dlg.ShowModal()
        dlg.Destroy()
        event.Skip()

Looks pretty ok, and it works in a handler for a wxButton. If I
execute the same code from a menu handler, I get a dead object error:

    raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the ArchiverMgtDlg object
has been deleted, attribute access no longer allowed.

The wxFrame is generated by wxGlade, and the menu event seems to get
fired, however I cannot instantiate a dialog from that menu handler.

The code is here: http://www.xs4all.nl/~jorgb/dead_object.zip

wxGlade project is included, if you fire up Archivision.py and select
from the file menu -> Archivers .. the same code is executed as
pressing the [Backup] button. One works, the other crashes.

wxPython 2.8.0 Unicode Debug Build

Does anyone have any idea? I was going along so well, but I am puzzled
as I am not seeing what I am doing wrong..

- Jorgen




More information about the wxpython-users mailing list