Ruby and glade/gtk+

Hi, well i’m going to explain my problem.

RUBY

I’m a windows user, but i want to program on ruby 1.9, there wasn’t a
msi installer so i downloaded the binaries (Ruby 1.9.1-p129-i386 Binary)
and put it on “C:”, then i modified the path variable to the ruby/bin
directory; then i tried a “hello world” with scite, pressed f5 and it
works! :smiley: (just like php).

GLADE/GTK

Then i donwloaded the msi installer for glade 3.6.7 and gtk+ both came
in one msi installer, no need to correct path variable i guess, then i
install it on “C:”, i want this versions because i’ve heard that
libglade is deprecated, now gtkbuilder rules, well, glade runs ok.

PROBLEM

i don’t know what is missing, because i tried some code from internet
calling a simple window and returns this error:

in `require’: no such file to load – Gtk (LoadError)

this is the code:

require ‘Gtk’

window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)
button = Gtk::Button.new(“Hello World”)

window.set_title(“Hello Ruby”)
window.border_width(10)

Connect the button to a callback.

button.signal_connect(‘clicked’) { puts “Hello Ruby” }

Connect the signals ‘delete_event’ and ‘destroy’

window.signal_connect(‘delete_event’) {
puts “delete_event received”
false
}
window.signal_connect(‘destroy’) {
puts “destroy event received”
Gtk.main_quit
}

window.add button
window.show_all
Gtk.main

Please help, thank you

Subject: [ruby-gnome2-devel-en] ruby and glade/gtk+
Date: sab 01 mag 10 01:28:51 +0200

Quoting Rodrigo Durá ([email protected]):

require ‘Gtk’
I am not a windows user, but in my linux code I have to write

require ‘gtk2’

(note the lowercase g and the 2 at end)

I believe this should be the case for windows, too.

HTH

Carlo

  •     Se la Strada e la sua Virtu' non fossero state messe da 
    

parte,

  • K * Carlo E. Prelz - [email protected] che bisogno ci
    sarebbe
    •           di parlare tanto di amore e di rettitudine? 
      

(Chuang-Tzu)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs