Hi,
I want to make a little nice GUI for an Arduino project I am currently
working on, I want to use Ruby for it. I do not want to use
“ruby-gnome2”. So I have not put this into the “Ruby-Gnome2” section So
I use Glade to “produce” my GUI and then I want to write my Ruby code.
After some research I have found out how to make it work at a minimum:
#!/usr/bin/env ruby
require 'rubygems'
require 'gtk3'
def testfunction()
print "Hello"
end
builder = Gtk::Builder.new
builder.add_from_file("test.glade")
builder.connect_signals {|handler| method(handler) }
window = builder.get_object("window1")
window.show_all()
Gtk.main()
It is just a window with one button to press.
Ok I have not add a function that it closes correctly and such, but I
haven’t use Ruby for some time and I am completly new when it comes to
GUIs. So I am currently looking for some examples or projects where I
can see how all this works and how more experience people do it and how
good programming style looks like. It would be very nice if you could
share some links or experiences or some code with me.
I am looking forward to hear from you.
King regards,
Greeneco