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

Robin Dunn robin at alldunn.com
Mon Oct 2 14:51:19 PDT 2006


John Salerno wrote:
> Robin Dunn wrote:

>>
>> 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>
>>
> 
> Ah ha! Thanks! So which is the preferred method? 

If you need to have direct access to the menubar before you give it to 
the frame, or if you need to change menubars over the life of the app, 
the define them separately.  Otherwise define it inside the frame object.


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





More information about the wxpython-users mailing list