XRCed: Most simple example won't work, what am I doing wrong?

Markus Schöpflin markus.schoepflin at comsoft.de
Thu May 10 06:17:57 PDT 2007


Roman Rolinsky wrote:

> Hi,
> 
> It's a bug in pywrc tool - it does not support a MenuBar inside a
> top-level window (actually it supposes all window children can be found
> by FindItemById from the main objct which is not the case for menu
> classes). 
> 
> 	self.MENU_FILE = xrc.XRCCTRL(self, "MENU_FILE")
> 	self.COMMAND_QUIT = self.FindItemById(xrc.XRCID("COMMAND_QUIT"))
> 
> it sould have generated something like
> 
>         self.MENU_FILE = self.GetMenuBar()
> 	self.COMMAND_QUIT = self.MENU_FILE.FindItemById(xrc.XRCID("COMMAND_QUIT"))
> 
> GetMenuBar is needed because XRCCTRL can't find the menubar object
> (maybe because it's not really a control). Actually the name MENU_FILE
> in the XRC file is probably ignored colpletely.

Is there some workaround I can employ, apart from manually editing the generated sources?

> pywrc is a separate tool which is called by XRCed, and provides only
> basic code generaion, which can be often used as a starting point for a
> project but sometimes requires hand-editing. I'm working on a general
> way to provide code-generation from XRCed in the future version.

Thanks for the clarification.

Markus





More information about the wxpython-users mailing list