I was playing with the Gtk::TrayIcon to create something like Gaim's tray icon. As you can see from the example, it is definately no so helpful to a GTK/GTK2 newbie like me.
I want to create a button-like icon where I can click on it and a new window pops up, like Gaim. :) The example only shows how to add Gtk::Label and I was wondering how the hell to put a icon where I can click. The trick is to use Gtk::EventBox and wrapped inside the icon you want to use. I will save you the trouble of going through the loop by showing you the code below.
window = Gtk::Window.new
window.title = “Test window for fun and maybe profit“
tray = Gtk::TrayIcon.new(“test“)
icon = Gtk::Image.new(Gdk::Pixbuf.new(“tools.svg“, 24, 24))
clickableIcon = Gtk::EventBox.new.add(icon)
puts “hello world”