Created
January 13, 2013 00:32
-
-
Save simonkro/4521310 to your computer and use it in GitHub Desktop.
Toying around with Gtk bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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