Skip to content

Instantly share code, notes, and snippets.

@simonkro
Created January 13, 2013 00:32
Show Gist options
  • Save simonkro/4521310 to your computer and use it in GitHub Desktop.
Save simonkro/4521310 to your computer and use it in GitHub Desktop.
Toying around with Gtk bindings
require 'gir_ffi-gtk3'
Gtk.init
app = Gtk::Application.new('org.gtk.example', :flags_none)
app.signal_connect('startup') do
window = Gtk::ApplicationWindow.new(app)
menu = Gtk::Menu.new
menu_item = Gtk::MenuItem.new
menu_item.label = 'test'
menu.append(menu_item) { puts 'Yes!' }
# next line gives me this error:
# (ruby:21453): GLib-GObject-CRITICAL **: g_value_set_instance: assertion `g_value_type_compatible (G_TYPE_FROM_INSTANCE (instance), G_VALUE_TYPE (value))' failed
app.app_menu = menu
window.show
end
app.run(ARGV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment