Sha256: 9e38bfa7144e4e26e895594ddc93628a6eb4880a8c0f84381a3460b2e8b219a6

Contents?: true

Size: 506 Bytes

Versions: 13

Compression:

Stored size: 506 Bytes

Contents

#!/usr/bin/env ruby
#
# Based on the 'Hello world' Gtk+ tutorial example at
# http://library.gnome.org/devel/gtk-tutorial/2.90/c39.html#SEC-HELLOWORLD
#
require 'gir_ffi-gtk3'

Gtk.init

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

win.signal_connect("destroy") { Gtk.main_quit }
win.border_width = 10

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

win.add but

but.show
win.show

Gtk.main

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gir_ffi-gtk-0.15.0 examples/02_hello_world.rb
gir_ffi-gtk-0.14.1 examples/02_hello_world.rb
gir_ffi-gtk-0.14.0 examples/02_hello_world.rb
gir_ffi-gtk-0.13.1 examples/02_hello_world.rb
gir_ffi-gtk-0.13.0 examples/02_hello_world.rb
gir_ffi-gtk-0.12.1 examples/02_hello_world.rb
gir_ffi-gtk-0.12.0 examples/02_hello_world.rb
gir_ffi-gtk-0.11.0 examples/02_hello_world.rb
gir_ffi-gtk-0.10.0 examples/02_hello_world.rb
gir_ffi-gtk-0.9.0 examples/02_hello_world.rb
gir_ffi-gtk-0.8.1 examples/02_hello_world.rb
gir_ffi-gtk-0.8.0 examples/02_hello_world.rb
gir_ffi-gtk-0.7.2 examples/02_hello_world.rb