From: Dobai-Pataky B. <dp...@gm...> - 2006-09-25 07:17:13
|
have you tried having a set_model(Gtk::ListStore) after your super() ? try 'p model.inspect' or 'p model.methods' before your model.clear, to=20 see, if there's a model assigned. DaVinci wrote: > Hi everybody. > > I have a little problem with version 0.15 of Ruby-Gtk2. Look at this > class: > > --------------------------- > class BotonOpciones < Gtk::ComboBox > def initialize(valores=3Dnil, inicial=3Dnil) > super() > aniadir_opciones(valores, inicial) if valores > end > > # Esta funci=F3n est=E1 separada para que se puedan cambiar las > # opciones todas las veces que sea necesario. > def aniadir_opciones(valores, > inicial=3Dnil) > =09 > model.clear # HERE IS THE PROBLEM!!!!!! > @valores =3D valores > @valores.each do |v| > append_text(v) > end > if inicial > poner_valor(inicial) > end > end > end > -------------------------------------------------- > > When I try "model.clear", get the error: > > `aniadir_opciones': undefined method `clear' for > #<#<Class:0xb6750eac>:0xb66c6f90 ptr=3D0x85c6790> (NoMethodError) > > It worked until 0.14 version, and API documentation doesn't show any > deprecation or change. > > Is this a known problem? Perhaps a bug? > > Thank you. > > David > > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share= your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > =20 |