Re: Boa - difficulties with custom classes - think I have found a bug

Riaan Booysen <[email protected]>
Newsgroups gmane.comp.ide.boa-constructor.user
Message-ID <[email protected]>
Hi Tim,

Tim Burgess wrote:
> Hi,
> I have been following the page http://wiki.wxpython.org/BoaFAQ.
> 
> I seem to have upset Boa and I cant see what I have done. Can anyone 
> offer a clue?
> 
> The application I am working on runs in my development environment 
> (WingIDE) as intended, but BOA says that the items defined in the custom 
> classes statement are not defined on the palette.
> I only mention it working under WingIDE so that you know there are no 
> syntax errors and nothing missing from what I am doing.
> 
> If I hand change the calls to the custom classes and replace with the 
> base class, boa will permit editing AND setting of the class via the 
> constr class field just like the BoaFAQ page seems to be saying.
> 
> However if you then save your work and re use the design tool, Boa says 
> that the custom classes are not defined on the palette.  Argggggh!
> 
> I start with this code:
> 
> ------------------------------------------------------
> 
> #Boa:Frame:Frame1
> 
> import FramePanelPage1  # exists and works
> import FramePanelPage2 # exists and works


Change this to:

from FramePanelPage1 import FramePanelPage1
from FramePanelPage2 import FramePanelPage2


> import wx
> 
> def create(parent):
>     return Frame1(parent)
> 
> [wxID_FRAME1, wxID_FRAME1NOTEBOOK1, wxID_FRAME1PANEL1, wxID_FRAME1PANEL2,
> ] = [wx.NewId() for _init_ctrls in range(4)]
> 
> 
> class Frame1(wx.Frame):       
>     _custom_classes = {'wx.Panel': ['FramePanelPage1.FramePanelPage1', 
> 'FramePanelPage2.FramePanelPage2']}


And this to:

      _custom_classes = {'wx.Panel': ['FramePanelPage1', 'FramePanelPage2']}

<snip>

> 
> You can see that Boa has made the custom class substitution

Yes Boa will willingly replace with ANY value you defined in the
custom classes (they are handled as strings).

> 
> Now I ask Boa to edit again
> 
>         DesignerError: FramPanelPage1.FramePanelPage1 is not defined on 
> the Palette.
> 
> Surely if this were true then Boa wouldn't have let me select the 
> classes in the first place!
> 
> What's happening?
>  How do I get Boa to let me edit the code, other than my me hand 
> removing the custom classes?

Change your code as I showed above so that the actual class you
use is visible to Boa. It works for me.

Cheers,
Riaan.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.