File: scalebutton.rb

package info (click to toggle)
ruby-gnome2 1.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,348 kB
  • sloc: ansic: 68,323; ruby: 21,381; sh: 76; xml: 35; makefile: 21
file content (25 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/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 'gtk2'

if str = Gtk.check_version(2, 12, 0)
    puts "This sample requires GTK+ 2.12.0 or later"
    puts str
    exit
end

window = Gtk::Window.new
window.add(scale = Gtk::ScaleButton.new(Gtk::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