Class: Drx::TkGUI::VBox

Inherits:
TkFrame
  • Object
show all
Defined in:
lib/drx/tk/app.rb

Overview

Arranges widgets one below the other.

Direct Known Subclasses

HBox

Instance Method Summary collapse

Constructor Details

#initialize(parent, widgets) ⇒ VBox

Returns a new instance of VBox.



577
578
579
580
581
582
583
584
# File 'lib/drx/tk/app.rb', line 577

def initialize(parent, widgets)
  super(parent)
  widgets.each { |w, layout|
    layout = default_layout.merge(layout || {})
    w.raise
    w.pack(layout)
  }
end

Instance Method Details

#default_layoutObject



585
586
587
# File 'lib/drx/tk/app.rb', line 585

def default_layout
  { :in => self, :side => 'top', :fill => 'x' }
end

#raiseObject



588
589
590
# File 'lib/drx/tk/app.rb', line 588

def raise
  pack_slaves.each {|w| w.raise }
end