Hi all, I''m facing a problem generating base classes using xrcise. i''ve this xrc layout: <?xml version="1.0" encoding="UTF-8"?> <resource version="2.3.0.1" xmlns="http://www.wxwidgets.org/wxxrc"> <object class="wxFrame" name="ID_NOTIFIER" subclass="notifier"> <style>wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxCLOSE_BOX|wxFULL_REPAINT_ON_RESIZE</style> <size>300,400</size> <title>wxnc</title> <object class="wxMenuBar" name="ID_MENUBAR"> <object class="wxMenu"> <label>File</label> <object class="wxMenuItem" name="ID_CONNETTI_MENU_ITEM"> <label>Connetti</label> </object> <object class="separator"> </object> <object class="wxMenuItem" name="wxID_EXIT"> <label>Esci</label> </object> </object> </object> <object class="wxNotebook" name="ID_NOTEBOOK" subclass="notebook"> <style>wxRAISED_BORDER</style> <object class="notebookpage"> <label>Contatti</label> <object class="wxPanel" name="ID_FOLDER_CONTATTI" subclass="contatti"> <style>wxSUNKEN_BORDER|wxTAB_TRAVERSAL</style> </object> </object> <object class="notebookpage"> <label>Configurazione</label> <object class="wxPanel" name="ID_FOLDER_CONFIG" subclass="config"> <style>wxSUNKEN_BORDER|wxTAB_TRAVERSAL</style> </object> </object> </object> </object> </resource> ..as the xrcise tutorial<http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise>say: " Note that whereas the "Class" field of top-level Frames, Dialogs and Panels will become Ruby *classes*, for the controls within a container, the "Class" field is the name of a Ruby *module* used to extend the control." but no classes are generated for the two panels inside wxNotebook (contatti and config) Is there any options to force panel class generation? My platform is ubuntu 7.x - Ruby 1.8.5 - wxruby 1.9.7 - wx_sugar 0.1.20 thank you. f. _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Hi Fabio Fabio Petrucci wrote:> I''m facing a problem generating base classes using xrcise. > > i''ve this xrc layout: > ... > > ..as the xrcise tutorial > <http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise> say: > > " Note that whereas the "Class" field of top-level Frames, Dialogs and > Panels will become Ruby *classes*, for the controls within a > container, the "Class" field is the name of a Ruby *module* used to > extend the control." > > but no classes are generated for the two panels inside wxNotebook > (contatti and config) > > Is there any options to force panel class generation? >It doesn''t really work this way. The class always corresponds to a top-level element in the XRC - in this case, your frame. This limitation comes from WxWidgets. This base class is generated by XRCise. To link ruby code behaviours to contained elements - like your panels - you write a ruby a module with the same name as the ''subclass'' attribute in the XRC. Then, when the whole layout is loaded from XRC, the elements will be extend-ed with that module. hth alex