Sha256: 8d311f66d9337b4935e81dcf87a92c3caf31302c7c02bdcf7e65ec9dd1bc8b0f

Contents?: true

Size: 617 Bytes

Versions: 6

Compression:

Stored size: 617 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-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 }
# FIXME: #border_width= should work
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-gtk-0.7.1 examples/02_hello_world.rb
gir_ffi-gtk-0.7.0 examples/02_hello_world.rb
gir_ffi-gtk-0.6.0 examples/02_hello_world.rb
gir_ffi-gtk-0.5.0 examples/02_hello_world.rb
gir_ffi-gtk-0.4.1 examples/02_hello_world.rb
gir_ffi-gtk-0.4.0 examples/02_hello_world.rb