Class: JLDrill::Gtk::OptionsWindow::Scale
- Inherits:
-
Object
- Object
- JLDrill::Gtk::OptionsWindow::Scale
- Defined in:
- lib/jldrill/views/gtk/widgets/OptionsWindow.rb
Overview
A horizontal slider with a label on the left
Instance Attribute Summary collapse
-
#box ⇒ Object
readonly
Returns the value of attribute box.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
Instance Method Summary collapse
-
#add(widget, expand = true, fill = true, padding = 0) ⇒ Object
Add a widget to the right of the slider.
-
#initialize(label, first, last, step) ⇒ Scale
constructor
A new instance of Scale.
Constructor Details
#initialize(label, first, last, step) ⇒ Scale
Returns a new instance of Scale.
31 32 33 34 35 36 37 |
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 31 def initialize(label, first, last, step) @box = Gtk::HBox.new() @label = Gtk::Label.new(label + ": ") @scale = Gtk::HScale.new(first, last, step) @box.pack_start(@label, false) @box.pack_start(@scale, true) end |
Instance Attribute Details
#box ⇒ Object (readonly)
Returns the value of attribute box.
29 30 31 |
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 29 def box @box end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
29 30 31 |
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 29 def label @label end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
29 30 31 |
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 29 def scale @scale end |
Instance Method Details
#add(widget, expand = true, fill = true, padding = 0) ⇒ Object
Add a widget to the right of the slider
40 41 42 |
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 40 def add(, =true, fill=true, padding=0) @box.pack_start(, , fill, padding) end |