All pastes #578885 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-20 12:47 UTC
rendered paste body
20 13:26:12 -!- mmmmattski [n=matt@ppp121-45-205-174.lns1.bne1.internode.on.net] has joined #wxWidgets
20 13:35:15 < mmmmattski> I'm fairly new to wxwidgets. I'm having a problem with window deletion on quit. I'm modelling my app on the
                          'docview' sample for starters. When a window is closed with it's close box, it's view's "OnClose" function is
                          called, which closes the document, and then deletes the window. However, when the app is quit (cmd+Q on mac), the
                          window is deleted, but it's view's OnClose is not called, then the app crashes because the doc
20 13:36:01 < BrianHV> Gonzo: you can subclass wxEvent or wxCommandEvent and put whatever you want in it
20 13:36:08 < mmmmattski> Also, is there a subversion repository server or is it only CVS?
20 13:36:29 < BrianHV> Gonzo: and wxCommandEvent already has client data functionality
20 13:36:42 < BrianHV> mmmmattski: they're investigating svn, but right now it's just cvs
20 13:37:19 < mmmmattski> The default closing action from wxDocument and wxView seems fine for normal window closes (directed by user)... just
                          not on app quit.
20 13:37:21 < mmmmattski> ta.
20 13:37:40 < BrianHV> mmmmattski: typically you don't delete the window in the close event.  does the docview sample do that?
20 13:37:51 < mmmmattski> yeah.
20 13:38:30 < BrianHV> I don't even see a close event in my docview sample
20 13:39:25 < mmmmattski> In the view class OnClose.... deletes the frame. I thought I read in the documentation that you should use
                          wxWindow::Destroy and not delete.
20 13:39:45 -!- W0rmDrink [n=ea@196.211.63.50] has joined #wxwidgets
20 13:39:54 < BrianHV> you should.  that's a poor example...
20 13:41:06 < BrianHV> ok, document/view doesn't seem to use events to close windows, preferring virtual methods.  interesting.
20 13:42:28 < BrianHV> so in docview, you should destroy the window.  I don't know why you're crashing though.
20 13:44:51 -!- mmmmattski [n=matt@ppp121-45-205-174.lns1.bne1.internode.on.net] has quit [Read error: 104 (Connection reset by peer)]
20 13:45:50 -!- mmmattski [n=matt@ppp121-45-205-174.lns1.bne1.internode.on.net] has joined #wxWidgets
20 13:46:32 < mmmattski> BrianHV: I'm back... my machine just hung (wierd). Sorry - is there a way to rewind the chat a bit in IRC?