Sha256: eca2521154152b2f2eeaee92cffb1bc1850c7b419a38d183d6a9db5d8cd3cf9c

Contents?: true

Size: 602 Bytes

Versions: 6

Compression:

Stored size: 602 Bytes

Contents

#
# Based on the 'Hello world' Gtk+ tutorial example at
# http://library.gnome.org/devel/gtk-tutorial/2.90/c39.html#SEC-HELLOWORLD
#
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'gir_ffi'

GirFFI.setup :Gtk, '2.0'

Gtk.init

win = Gtk::Window.new(:toplevel)
GObject.signal_connect win, "delete-event" do
  puts "delete event occured"
  true
end

GObject.signal_connect(win, "destroy") { Gtk.main_quit }
win.set_border_width 10

but = Gtk::Button.new_with_label("Hello World")
GObject.signal_connect(but, "clicked") { win.destroy }

win.add but

but.show
win.show

Gtk.main

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gir_ffi-0.0.14 examples/02_hello_world.rb
gir_ffi-0.0.13 examples/02_hello_world.rb
gir_ffi-0.0.12 examples/02_hello_world.rb
gir_ffi-0.0.11 examples/02_hello_world.rb
gir_ffi-0.0.10 examples/02_hello_world.rb
gir_ffi-0.0.9 examples/02_hello_world.rb