Sha256: 4206d4525ac43ff3abced9f9c1fb45eaf7cad2a754c4fef631f152e114ca4463

Contents?: true

Size: 1.03 KB

Versions: 38

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
=begin
  misc_button.rb - Ruby/GTK sample script.

  Copyright (c) 2004-2020 Ruby-GNOME Project Team
  This program is licenced under the same licence as Ruby-GNOME.
=end

require "gtk3"

box = Gtk::Box.new(:vertical)

# Gtk::ColorButton
colorbutton = Gtk::ColorButton.new
colorbutton.signal_connect("color-set") do
  p colorbutton.color.to_s
end
box.add(colorbutton)

# Gtk::FontButton
fontbutton = Gtk::FontButton.new
fontbutton.signal_connect("font-set") do
  p fontbutton.font_name
end
box.add(fontbutton)

# Gtk::FileChooserButton
filebutton = Gtk::FileChooserButton.new("Gtk::FileChooserButton", :open)
filebutton.filename = GLib.home_dir
filebutton.signal_connect("current-folder-changed") do |w, e|
  p filebutton.filename
end

box.add(filebutton)

# Quit
quitbutton = Gtk::Button.new(:label => "Quit")
quitbutton.signal_connect("clicked") do
  Gtk.main_quit
end
box.add(quitbutton)

win = Gtk::Window.new
win.add(box)
win.set_default_size(200, 100)
win.show_all
win.signal_connect("delete-event") { Gtk.main_quit }

Gtk.main

Version data entries

38 entries across 38 versions & 1 rubygems

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