I have installed the packages ruby1.8, ruby1.8-dev, ruby-gnome2,
libglade-2, glade-gnome and glade-3.
I thought I have all installed but when I follow this tutorial : (in
french) : http://www.rubyfr.org/documentations/ruby-ihm/ruby-gnome/gnome2-glade/ ,
I launch the project under eclipse (“run script”) and … nothing
happens : no error message, no message at the console.
if I add “puts ‘hello’” at the end of the script … it doesn’t appear
at the console window…
maybe there is a problem with libglade2 and gtk2, but what is it?
the gem tool tells me there is no gem installed (maybe libglade2 and
gtk2 aren’t recognized, but how to be sure?).
first, the line with “show_all” is rejected : the compiler says that
the nil object doesn’t have the method “show_all” (the error seems hence
to be at the line above, the GladeXML.new)
secondly : after “a=MonAppli.new…”, I tried “a.glade” but it is not
recognized.in theory, is it well? why can’t I obtain this field?
I succeeded in displying the window!
I changed the path to the file fenetre_2.glade, with the path of the
copy of the file but in an other directory, and it went well.
nevertheless, do you know the answer at the two questions in my previous
post?
am Sat, 25 Apr 2009 12:39:30 +0200, tat Olivier Saint-eve [email protected] der Welt kund:
Hi,
but I obtain two errors:
first, the line with “show_all” is rejected : the compiler says that
the nil object doesn’t have the method “show_all” (the error seems hence
to be at the line above, the GladeXML.new)
I tried your example and it works for me.
If Glade doesn’t find the glade file you will get a error message like
libglade-WARNING **:could not find glade file
But you get an error message, that show_all doesn’t exist for nil. That
means that your glade file is successfully loaded. But in you glade
file is no object called fenetre_2.
With @main_glade_xml[‘some_widget’] you ask for a widget, that is
called some_widget in your glade file. So your main window has to be
named fenetre_2.
Btw. it would be useful, if you also post the error output of the
console for the example code.