File: scale.rb

package info (click to toggle)
ruby-gnome2 3.1.0-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,072 kB
  • ctags: 17,433
  • sloc: ansic: 93,621; ruby: 62,273; xml: 335; sh: 246; makefile: 25
file content (28 lines) | stat: -rw-r--r-- 627 bytes parent folder | download | duplicates (5)
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
26
27
28
# Copyright (c) 2015-2016 Ruby-GNOME2 Project Team
# This program is licenced under the same licence as Ruby-GNOME2.
#
=begin
= Scale

GtkScale is a way to select a value from a range.
Scales can have marks to help pick special values,
and they can also restrict the values that can be
chosen.
=end

class ScaleDemo
  def initialize(main_window)
    builder = Gtk::Builder.new(:resource => "/scale/scale.ui")
    builder.connect_signals {}
    @window = builder["window1"]
    @window.screen = main_window.screen
  end

  def run
    if !@window.visible?
      @window.show_all
    else
      @window.destroy
    end
  end
end