I am new here and to wxWindows. My first question is when to delete wxXXX-Object (like wxButton, etc.) i created with new. Or takes the close()-methode of the wxFrame care of this?
Yes, this is called "managed window". For each control with parent argument in its constructor, you needn't delete it, in my understanding. May check the "controls" sample at samples directory for learning.
3. Re: When do delete wxObjects?
#2491
Posted by: 2003-08-21 01:23:32
In addition to what Guidance said I'd give you the advice not bother too much about deleting objects. Try to go without it as long as you can. I experienced some very nasty crashes once while writing an app and all debugging didn't really help. Afterwards I found out that it only came from an object I deleted and wx was trying to delete it again.
Normally wx takes care of created objects by itself. Only on rare occasions you may want/have to delete objects explicitly.
> Afterwards I found out that it only came from an object I > deleted and wx was trying to delete it again.
What're these objects for instance? I understand only these controls have "parent" argument will be deleted by wxWindows automatically, other objects not.
5. Re: When do delete wxObjects?
#2511
Posted by: 2003-08-22 00:09:51
I don't remember exactly what it was, but I think it had something to do with menu items that had to be deleted in order to support internationalisation...