Re: [Boa Constr] Interface comments
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2001-01-18 14:55:05
|
Hi Bernard, you keep on asking the tricky question don't you ;) Bernhard Reiter wrote: > > I see there are a few new bugs reported, I wish > > I could get SourceForge to forward these by email too! > > I know that it can be done from other projects. > You might want to check the options again. I have, and I will when I can log in again (I've just installed a new browser, so I will get to the soon) > I have a couple of other things, I noticed when running Boa. > > In CVS Version from the 16th of January: > - How can I select a wxListBox in the Frame Designer. > (I can do it using the Objs Tab.) Some controls do not register clicks like all the others (statusbar on MSW and Gen*Buttons) others report different objects in the event handler (wxListCtrl on GTK, but I think this has been fixed). I think your wxListBox may also be reporting the wrong objects in the event. I will investigate. > > - How can I replace the main frame of an application and switch on > autocreate for other frames? (This is probably something I just > missed in the docs..) In short, you must currently change the main frame by hand. Autocreation has not been completely implemented. I've not yet decided on the best strategy to implement it. One way would be to create the frame in it's module scope. The singleton pattern. Also the way Delphi does it. E.g. in wxFrame1.py add frame1 = create(None) to the bottom of the module. This way the autocreated frame can be accessed as wxFrame1.frame1. The first problem is that it's not compatible with the current strategy of creating the main frame. Another problem is the management of the new name 'frame1'. Frames currently manage their class name, not an instance name. Yet another problem is the destruction of these global (in module scope) frames. Who should destroy them? If they are not destroyed the wxApp will not terminate. We can't destroy them in wxApp.OnExit because this won't get fired until they are destroyed. Chicken and egg. This also requires that the main frame's import not be done in module scope as that will cause 2 wxApps to be created which is an error. It would be nice if all autocreated frames could be children of the main frame (who would then destroy them when it closes) but alas, because these objects are created at compile time (module scope) this would require an import and a reference of the main frame in autocreated frames (which has to be updated on renames) Too much management. Another way would have been to keep a global dict in the wxApp's module which keeps track of the autocreated frames. This doesn't work because the wxApp module is not added to sys.modules, therefore when another module imports wxApp's module (the main module), it will create a new global object and won't return the actual dict that the wxApp module maintains. :/ This rather rare Python peculiarity can be worked around by importing the autocreated dict from itself inside the main module. e.g. in wxApp1.py: autocreated = {} from wxApp1 import autocreated This assures that App1 will be in sys.modules and that anyone else that imports wxApp1 will have access to the same autocreated dict. I do not want to use this pervertiom (perverted idiom) in EVERY app that Boa creates. What would you think if you read the above mentioned code? Any better ideas? > > - I have been adding my own control and somehow Boa did not > recognize what I have been done and editing this frame in the > designer lead to code being deleted by Boa. There should be guidline > on how to add own elements to boa so that the frame designer can > handle it. Was it a control not supported by Boa? Someone else also recently ran into this, the guideline is: Do not modify _init_* methods, Boa parses and regenerates these methods. Any code in these methods that do not comply exactly with the format that Boa expects will be lost. What you should have done was to create your control in the __init__ method underneath _init_ctrls(). As promised before, this will be added to the documentation. > > Best, > Bernhard > > -- > Professional Service around Free Software (intevation.net) > The FreeGIS Project (freegis.org) > Association for a Free Informational Infrastructure (ffii.org) > FSF Europe (www.fsfeurope.org) > > ------------------------------------------------------------------------ > Part 1.2Type: application/pgp-signature -- Riaan Booysen ___________________________________________________ Boa Constructor - RAD GUI building IDE for wxPython http://boa-constructor.sourceforge.net |