[wxPython-users] Re: [pydocview] Segmentation fault when opening
two SDI views with the same document
Robin Dunn
robin at alldunn.com
Mon Oct 1 13:02:47 PDT 2007
Klaus Nowikow wrote:
> Klaus Nowikow wrote:
>> In my application I'd like to be be able to open two or more
>> views with one document. I had some problems with this, so I
>
> Sorry, I just noticed that I forgot to mention that I want to use the SDI
> interface.
>
>> tried to change the pydocview demo in the samples folder to
>> open two views instead of one by changing these lines in
>> TextEditorApplication.OnInit():
>>
>> if not docManager.GetDocuments() and docManager.GetFlags() & wx.lib.docview.DOC_SDI:
>> textTemplate.CreateDocument('', docview.DOC_NEW).OnNewDocument()
>>
>> to:
>>
>> if not docManager.GetDocuments() and docManager.GetFlags() & wx.lib.docview.DOC_SDI:
>> doc = textTemplate.CreateDocument('', wx.lib.docview.DOC_NEW)
>> doc.OnNewDocument()
>> textTemplate.CreateView(doc, 0)
>>
>> I now get two windows, but when I close both of them (not with File/Exit, but using
>> the window's Close button, the one that's top right in Windows) I get a segmentation
>> fault. Is this the wrong way to open multiple views for a single document?
I can't duplicate this with 2.8.6.0 but does it make a difference if you
use docManager.CreateView instead? It looks like that is what is
intended to be used to add a new view for an existing document.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list