Finding example for GTK3

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. :slight_smile:

I am looking forward to hear from you.

King regards,

Greeneco

working on, I want to use Ruby for it. I do not want to use
“ruby-gnome2”.

require ‘gtk3’

gtk3 is in ruby-gnome2 project !

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

for using glade and ruby, see visalruby :

if gui is simple, for one-script application, you can use :

  • green-shoes : gtk2 + shoes DSL
  • Ruiby : gtk3 DSL

both are gtk/ruby and lot of examples.

See rubygems.org for finding them.

My cremefraiche-gem is written against the gtk3 libraries. You can get
it either from rubygems.org (gem install) or Sourceforge. The latter
choice will provide you with zip- or 7z- files which also include the
gem.

All GUI-stuff is in a sub-directory of lib, so you should find your
examples. Know however that I added the GUI to an original command-line
project and do not give a damn about optimization or efficiency of my
using Gtk.