File: scalebutton.rb

package info (click to toggle)
ruby-gnome2 2.2.0-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,360 kB
  • ctags: 14,222
  • sloc: ansic: 85,875; ruby: 38,232; sh: 80; xml: 41; makefile: 22
file content (19 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby
=begin
  scalebutton.rb - Very simple Gtk::ScaleButton example.

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

  $Id: scalebutton.rb,v 1.1 2007/07/12 14:04:54 ggc Exp $
=end

require 'gtk3'

window = Gtk::Window.new
window.add(scale = Gtk::ScaleButton.new(Gtk::IconSize::IconSize::BUTTON))
scale.set_icons(['gtk-goto-bottom', 'gtk-goto-top', 'gtk-execute'])
scale.signal_connect('value-changed') { |widget, value| puts "value changed: #{value}" }
window.show_all

Gtk.main