Marshall Elfstrand
2004-Oct-19 14:46 UTC
[Wxruby-users] Loading wxListCtrl subclass from XRC file
I''m trying to use the wxLC_VIRTUAL style of the wxListCtrl, which seems to require that I subclass the control (as opposed to being able to provide a data model a la Swing or Cocoa), and I''m running into trouble when loading the control from an XRC file. Apparently I need to specify the name of my subclass in the XRC as follows: <object class="wxListCtrl" subclass="MyVeryOwnListCtrl" name="custom_list"> ... </object> When I do this, however, I get a message from WxWidgets saying that "Subclass ''MyVeryOwnListCtrl'' not found for resource ''custom_list'', not subclassing!". I gather from the WxWidgets documentation that the XML resource loader needs to know about the existence of my subclass somehow, but so far I haven''t been able to figure out how to do that. Any ideas? Thanks much, Marshall
wxruby doesn''t support XRC subclassing. I wish I could say it was on the radar, but it''s really a difficult thing to implement (XRC subclassing only works with C++ classes that use the wxClassInfo dynamic construction, which we don''t). Best I can suggest is put a panel where you want the list control to be, and then add the list control into the Panel after loading the dialog. Nick Marshall Elfstrand wrote:> I''m trying to use the wxLC_VIRTUAL style of the wxListCtrl, which > seems to require that I subclass the control (as opposed to being able > to provide a data model a la Swing or Cocoa), and I''m running into > trouble when loading the control from an XRC file. Apparently I need > to specify the name of my subclass in the XRC as follows: > > <object class="wxListCtrl" subclass="MyVeryOwnListCtrl" > name="custom_list"> > ... > </object> > > When I do this, however, I get a message from WxWidgets saying that > "Subclass ''MyVeryOwnListCtrl'' not found for resource ''custom_list'', > not subclassing!". I gather from the WxWidgets documentation that the > XML resource loader needs to know about the existence of my subclass > somehow, but so far I haven''t been able to figure out how to do that. > > Any ideas? > > Thanks much, > Marshall > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >