Sha256: 1cea3cdf7efe43b3a4a703e6d68f5d1595c5993825e03c0412b3bb89349c6f83

Contents?: true

Size: 577 Bytes

Versions: 5

Compression:

Stored size: 577 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 'ffi-gtk3'

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

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.2.3 examples/02_hello_world.rb
gir_ffi-0.2.2 examples/02_hello_world.rb
gir_ffi-0.2.1 examples/02_hello_world.rb
gir_ffi-0.2.0 examples/02_hello_world.rb
gir_ffi-0.1.0 examples/02_hello_world.rb