Class: JLDrill::Gtk::OptionsWindow::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/jldrill/views/gtk/widgets/OptionsWindow.rb

Overview

A vertical box with a label at the top

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label) ⇒ Section

Returns a new instance of Section.



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 49

def initialize(label)
    @box = Gtk::VBox.new()
    @label = Gtk::Label.new()
    @label.set_markup("<big><b>#{label}</b></big>")
    @label.set_alignment(0.0, 0.0)
    @box.pack_start(@label, true, true)
    indent = Gtk::HBox.new()
    indent.pack_start(Gtk::VBox.new(), false, false, 25)
    @contents = Gtk::VBox.new()
    indent.pack_start(@contents, true, true)
    @box.pack_start(indent)
end

Instance Attribute Details

#boxObject (readonly)

Returns the value of attribute box.



47
48
49
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 47

def box
  @box
end

#contentsObject (readonly)

Returns the value of attribute contents.



47
48
49
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 47

def contents
  @contents
end

#labelObject (readonly)

Returns the value of attribute label.



47
48
49
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 47

def label
  @label
end

Instance Method Details

#add(widget) ⇒ Object

Add a widget to the bottom of the box



63
64
65
# File 'lib/jldrill/views/gtk/widgets/OptionsWindow.rb', line 63

def add(widget)
    @contents.add(widget)
end