Sha256: 728c511f7c527bb647ee4c73cbf986e4e39319a1964ef6b3ad6024ddcc5b3aec

Contents?: true

Size: 789 Bytes

Versions: 36

Compression:

Stored size: 789 Bytes

Contents

#!/usr/bin/env ruby
=begin
  builder.rb - Ruby/GTK version of gtk+/examples/builder.c.
  https://git.gnome.org/browse/gtk+/tree/examples/builder.c?h=gtk-3-16
  Copyright (c) 2015 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=end

require "gtk3"

ui_file = File.expand_path("builder.ui", __dir__)
builder = Gtk::Builder.new
builder.add_from_file(ui_file)

win = builder.get_object("window")
win.signal_connect("delete-event") { Gtk.main_quit }

button = builder.get_object("button1")
button.signal_connect "clicked" do
  puts "Hello World!"
end

button = builder.get_object("button2")
button.signal_connect "clicked" do
  puts "Hello World!"
end

button = builder.get_object("quit")
button.signal_connect("clicked") { Gtk.main_quit }

Gtk.main

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
gtk3-4.2.5 sample/misc/builder.rb
gtk3-4.2.4 sample/misc/builder.rb
gtk3-4.2.3 sample/misc/builder.rb
gtk3-4.2.2 sample/misc/builder.rb
gtk3-4.2.1 sample/misc/builder.rb
gtk3-4.2.0 sample/misc/builder.rb
gtk3-4.1.9 sample/misc/builder.rb
gtk3-4.1.8 sample/misc/builder.rb
gtk3-4.1.7 sample/misc/builder.rb
gtk3-4.1.6 sample/misc/builder.rb
gtk3-4.1.5 sample/misc/builder.rb
gtk3-4.1.4 sample/misc/builder.rb
gtk3-4.1.3 sample/misc/builder.rb
gtk3-4.1.2 sample/misc/builder.rb
gtk3-4.1.1 sample/misc/builder.rb
gtk3-4.1.0 sample/misc/builder.rb
gtk3-4.0.9 sample/misc/builder.rb
gtk3-4.0.8 sample/misc/builder.rb
gtk3-4.0.7 sample/misc/builder.rb
gtk3-4.0.6 sample/misc/builder.rb