Class: Zerenity::Scale

Inherits:
Base
  • Object
show all
Defined in:
lib/zerenity/scale.rb

Overview

:nodoc:

Class Method Summary collapse

Methods inherited from Base

run

Class Method Details

.build(dialog, options) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/zerenity/scale.rb', line 27

def self.build(dialog,options)
  super(dialog,options)
  label = Gtk::Label.new(options[:text])
  hscale = Gtk::HScale.new(options[:min],options[:max],options[:step])
  hscale.value = options[:initial].to_f
  dialog.vbox.add(label)
  dialog.vbox.add(hscale)
end

.check(options) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/zerenity/scale.rb', line 19

def self.check(options)
  super(options)
  options[:initial] ||= 0.0
  options[:min] ||= 0.0
  options[:max] ||= 100.0
  options[:step] ||= 1.0
end

.retrieve_selection(dialog, options) ⇒ Object



36
37
38
39
# File 'lib/zerenity/scale.rb', line 36

def self.retrieve_selection(dialog,options)
  super(dialog,options)
  dialog.vbox.children[1].value.to_i
end