[pydocview] Error when closing an SDI application with multiple
windows using File->Exit
Klaus Nowikow
klaus.nowikow at tuwien.ac.at
Fri Oct 12 02:43:43 PDT 2007
Robin Dunn wrote:
> Klaus Nowikow wrote:
>> Klaus Nowikow wrote
>>> Hi!
>>>
>>> I am using wxPython 2.8.4.0 on Linux.
>>> [...]
>>
>> I just checked that the same happens with the pydocview demo:
>>
>> 1) open PyDocViewDemo.py
>> 2) Type something into the window
>> 3) Open a second window by selecting File->New
>> 4) Type something into the new window
>> 5) Select File->Exit from the menu of the /second/ window
>>
>> ==> Traceback
>>
>> This does not happen if you select File->Exit from the first window.
>
> It's just lucky that it doesn't do it in that case ;-)
>
> It looks like there has been some confusion about what OnExit should do,
> as in some places in the docview modules a method with that name is used
> as the handler for the menu event, and in other places it is used as a
> way for template and view classes to clean up after themselves. Anyway,
> changing DocSDIFrame.OnExit to just have this one line seems to take
> care of the problem:
>
> def OnExit(self, event):
> """
> Called when the application is exitting.
> """
> self._childView.GetDocumentManager().Clear(force = False)
Ah, I see. When I stepped into that method with the debugger I was a bit
confused because the flow of control seemed to 'hop' back and forth
between the document, the view, and the frame. Thank you for clarifying.
Should I report a bug, and if so, is the wxWidgets tracker at
http://sourceforge.net/tracker/?group_id=9863&atid=109863 the right place
to report wxPython/pydocview bugs?
--
Klaus
More information about the wxpython-users
mailing list