RE: [Boa Constr] 2 problems-- wxMenu and python crashing
Status: Beta
Brought to you by:
riaan
From: John B. <joh...@om...> - 2002-07-06 00:53:50
|
Excellent Riaan. Thanks so much for the help. It actually did read Docs/boa/apphelp/MixingSource.html (several times), its just that I didnt understand it. But I am learning fast and your last post helped quite a bit. Now my skeleton application works...sort of. I can now open it with the Inspector, but unfortunately the new code has introduced a new problem. It gives an error after execution, suggesting that I have memeory leaks. Do you know what would cause this? 7:33:33 PM: There were memory leaks. 7:33:33 PM: ----- Memory dump ----- 7:33:33 PM: wxDiagram at $1183298, size 32 7:33:33 PM: wxObject at $11A2258, size 28 7:33:33 PM: 7:33:33 PM: 7:33:33 PM: ----- Memory statistics ----- 7:33:33 PM: 1 objects of class wxObject, total size 28 7:33:33 PM: 1 objects of class wxDiagram, total size 32 7:33:33 PM: 7:33:33 PM: Number of object items: 2 7:33:33 PM: Number of non-object items: 0 7:33:33 PM: Total allocated size: 60 Im sure you are a very busy man and have other things to do than answer my questions, but I really do appreciate the help getting started. Just let me know if I am wearing out my welcome. Once I get some basics down, I think I will be fine. Best, John John Boik Oregon Medical Press www.ompress.com joh...@om... -----Original Message----- From: Riaan Booysen [mailto:riaan@e.co.za] Sent: Friday, July 05, 2002 7:16 PM To: joh...@om... Cc: Boa, Subject: Re: [Boa Constr] 2 problems-- wxMenu and python crashing Hello John, John Boik wrote: > > Thanks Riaan. > I did go to the web site and made the suggsted change in the > UtilCompanions.py file. Now I can add a menu. It works great. Cool! > I did try your suggestion on the initialization lines for the canvas. I had > to change them a bit to get it to work [see below...wxFrame1 (which is self) > did not have an attribute "diagram"]. Im not sure if I can draw yet, but > the application does execute at least. No errors. The problem is though > that by adding the new code into the init section, Boa no longer will allow > me to use the Frame Designer. Please follow the instructions that I posted previously, your code should then be equivalent to this: def __init__(self, parent): self._init_ctrls(parent) self.diagram = wxDiagram() self.diagram.SetCanvas(self.scrolledWindow1) self.scrolledWindow1.SetDiagram(self.diagram) As the Boa application help says, you should not add code to the methods that Boa generates and maintains; the _init_* methods. In the help you are also encouraged to make your the changes in the __init__ method after the self._init_ctrls call. > If I wanted to fix the crash on exit problem Add this snippet of code to the bottom of Preferences.py try: sys._wxApp_Cleanup = wx.__cleanMeUp except: pass to fix it. > I could upgrade to the new CVS > version, but Im not sure how to do that. I went to the CVS site and I see I > can download several different modules, but which ones do I want and how do > I install them in Windows? Do I just copy them over the old folders? Learning to use CVS is of value to any developer IMO. Boa is not released that regularly, so if you need support for the latest wxPython or new features/fixes then it's up to you to learn CVS. There's plenty of help on the web and in the Boa application help. I do suggest leaving it until you are more familiar with everything. > I could also downgrade to Python 2.1, but Im wondering if I would have to > uninstall 2.2 and wxWindows and Boa etc, since they are all in the same > Python22 directory. You can have more than one Python installation at a time, but as I said, this is a last option. Boa 0.1.0 was developed on wxPython 2.3.2 and Python 2.1, so that is where it will run the best. That said, you now have the major hickups of 0.1.0 patched so you should be fine. > Again, pardon my lack of experience...with a little help I will learn fast. Best advice I can give would be to make more use of the SourceForge tracker and the Boa application help. (esp. Docs/boa/apphelp/MixingSource.html). Learning Python/wxPython should be fun, so enjoy it! > > Best, > John Cheers, Riaan. |