Sha256: 51be323dc66e0b7196cf1db7969b49987abfbcb648d50aba792871b2e9c240cb

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 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 }
# 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

3 entries across 3 versions & 1 rubygems

Version Path
gir_ffi-0.3.2 examples/02_hello_world.rb
gir_ffi-0.3.1 examples/02_hello_world.rb
gir_ffi-0.3.0 examples/02_hello_world.rb