Sha256: 7e4dd84ada84e797bab2cb5f4a31f94f81e23dfab7852169da7d6be1f8f4f937

Contents?: true

Size: 1.24 KB

Versions: 38

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby
=begin
  misc_button.rb - Ruby/GTK sample script.
                                                                                
  Copyright (c) 2004-2006 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
                                                                                
  $Id: misc_button.rb,v 1.2 2006/06/17 13:18:12 mutoh Exp $
=end

require 'gtk3'

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

#Gtk::ColorButton
colorbutton = Gtk::ColorButton.new
colorbutton.signal_connect("color-set") do
  p colorbutton.color.to_a
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", 
                                    Gtk::FileChooser::Action::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)

Gtk::Window.new.add(box).set_default_size(200, 100).show_all

Gtk.main

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
gtk3-2.2.5-x64-mingw32 sample/misc/misc_button.rb
gtk3-2.2.5-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.2.5 sample/misc/misc_button.rb
gtk3-2.2.4-x64-mingw32 sample/misc/misc_button.rb
gtk3-2.2.4-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.2.4 sample/misc/misc_button.rb
gtk3-2.2.3-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.2.3 sample/misc/misc_button.rb
gtk3-2.2.2-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.2.2 sample/misc/misc_button.rb
gtk3-2.2.1-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.2.1 sample/misc/misc_button.rb
gtk3-2.2.0-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.2.0 sample/misc/misc_button.rb
gtk3-2.1.0-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.1.0 sample/misc/misc_button.rb
gtk3-2.0.3-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.0.3 sample/misc/misc_button.rb
gtk3-2.0.2-x86-mingw32 sample/misc/misc_button.rb
gtk3-2.0.2 sample/misc/misc_button.rb