Sha256: 2d4cc0617bb60a966d953285e713faf93747cd6ee64cee78eb1ae913cf5da375

Contents?: true

Size: 841 Bytes

Versions: 146

Compression:

Stored size: 841 Bytes

Contents

#!/usr/bin/env ruby
=begin
  application.rb - Ruby/GTK version of the example-1.c at
  https://developer.gnome.org/gtk3/stable/gtk-getting-started.html
  Copyright (c) 2015  Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=end

require "gtk3"
myapp = Gtk::Application.new("org.gtk.example", :handles_command_line)
myapp.signal_connect "command-line" do |app, command_line|
  app.activate
  0
end

myapp.signal_connect "activate" do |app|
  win = Gtk::ApplicationWindow.new(app)
  win.set_title("window")
  win.set_default_size 200, 200

  button_box = Gtk::ButtonBox.new(:horizontal)
  win.add(button_box)

  button = Gtk::Button.new(:label => "Hello World")
  button.signal_connect "clicked" do
    puts "Hello World"
    win.destroy
  end

  button_box.add(button)

  win.show_all
end

myapp.run

Version data entries

146 entries across 138 versions & 2 rubygems

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