Re: [Boa Constr] Boa - newbie question on subclassing and CodeCompletion
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2002-09-03 15:54:29
|
Hi Thomas, Thomas Runge wrote: > > Hi! > I have to admit having not very much experience with python programming and > being a Boa-newbie.... Welcome! > > Of course I'm very keen on finding a time-saving way of GUI-programming. Boa > definitely looks very exciting. After getting the latest CVS-revision of Boa > (yesterday), I was able to do a little "Hello world" app successfully within > a reasonable amount of time. Fine! > > While using Boa for another more sophisticated programming example, some > questions about the underlying philosophy of Boa did arise: > > A have realized that it is currently not possible to do subclassing with > wxWindows-controls and then use it in the Boa-designer. As subclassing is a > feature I use quite often, I would be interested to know: There are already two ways in which you can sub-class. The first way (you probably know of) is to define a new component for the Palette. This is a bit of effort but gives you complete control. See Plug-ins/UserCompanions.plug-ins.py, but maybe wait until the newbieness wears off before going this route. The second way is simpler but not as powerful. You may define a class attribute called _custom_classes which defines your sub-class name and the equivalent (in this case parent) wxWindows class. See Docs/boa/apphelp/ExtendingBoa.html (Available with the release version of Boa, not from CVS Note the other features for better integrating generated and hand crafted code.) Also see: Examples/advanced/CustomClasses/wxFrame1.py > - Shouldn't be python a programming language being "dynamically enough" to > close the gap between "compile-time" and "run-time"? I'm not sure, but I > think there are Java-GUI-builders that execute the code of the subclassed > control within the designer-window... There is a very clear separation between run-time behaviour and design-time behaviour, if you have a suggestion please be clearer about what you want. I have no problems with the current model. > When programming my first python-GUI-example, I realized that my personal > programming performance was quite low: Being new to wxPython, finding out > the right spelling of every wxPython API-function was rather > time-consuming... > > - Does Boa offer some features that assist the programmer during coding? Yes, Code Completion (Ctrl-Space, Call Tips (Ctrl-Shift-Space inside brackets) Code completion in Python is quite tricky as it's not always obvious from the source code what the type of an object is. Never the less code completion usually works well on the generated frame code. (Remember to refresh (Ctrl-R) the code so the internal parsed structures can be updated, or turn on auto refresh under Preferences) > I hope that nowbody gets me wrong. I consider Boa to be a great tool and I > just want to use Boa exactly the way it is intended to be used.... > > Thanks in advance.... > Thomas HTH, Riaan. |