[wxPython-users] Re: XRC and dynamically created widgets?

Robin Dunn robin at alldunn.com
Mon Oct 2 12:31:47 PDT 2006


John Salerno wrote:
> John Salerno wrote:
> 
>> Ah, I forgot to add the Notebook to a BoxSizer! Now it works! :)
> 
> Ok, more confusion. Here is my code and XRC. Why do I get this error 
> message when I don't comment out the two lines in the InitMenu() method, 
> but when they are commented it works fine (and still shows the menu bar)?
> 
> Python Error
> XRC resource 'menuBar' (class 'wxMenuBar') not found!

Because the menu bar is not a top-level item in your XRC file.  It is a 
child of the mainFrame so it is created and associated with the frame 
when the frame is loaded.  The Load* methods can only "see" items that 
are at the top-level in the resource, in other words their parent node 
is <resource>

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list