Sha256: 5a7a626b22aaf9635f7aaaa3fd57fd1ee50dfeea2a9840ee30a39ad57116725c

Contents?: true

Size: 860 Bytes

Versions: 5

Compression:

Stored size: 860 Bytes

Contents

#!/usr/bin/env ruby
=begin
  scalebutton.rb - Very simple Gtk::ScaleButton example.

  Copyright (c) 2007-2015 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=end

require "gtk3"

window = Gtk::Window.new
window.set_size_request(300, 300)
scale = Gtk::ScaleButton.new
scale.set_value(30)
scale.set_valign(Gtk::Align::END)
scale.set_halign(Gtk::Align::END)
box = Gtk::Box.new(:vertical)
box.add(scale)
box.vexpand = true
box.hexpand = true

window.add(box)
# see here for an explication  on icons order
# https://developer.gnome.org/gtk3/stable/GtkScaleButton.html#GtkScaleButton--icons
scale.set_icons(%w(gtk-goto-bottom gtk-goto-top gtk-execute))
scale.signal_connect("value-changed") { |_widget, value| puts "value changed: #{value}" }

window.show_all

window.signal_connect("destroy") { Gtk.main_quit }
Gtk.main

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gtk3-3.0.1-x86-mingw32 sample/misc/scalebutton.rb
gtk3-3.0.1-x64-mingw32 sample/misc/scalebutton.rb
gtk3-3.0.1 sample/misc/scalebutton.rb
gtk3-3.0.0-x86-mingw32 sample/misc/scalebutton.rb
gtk3-3.0.0-x64-mingw32 sample/misc/scalebutton.rb