Class: Zerenity::Scale
Overview
:nodoc:
Class Method Summary collapse
- .build(dialog, options) ⇒ Object
- .check(options) ⇒ Object
- .retrieve_selection(dialog, options) ⇒ Object
Methods inherited from Base
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,) super(dialog,) label = Gtk::Label.new([:text]) hscale = Gtk::HScale.new([:min],[:max],[:step]) hscale.value = [: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() super() [:initial] ||= 0.0 [:min] ||= 0.0 [:max] ||= 100.0 [: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,) super(dialog,) dialog.vbox.children[1].value.to_i end |