Separator
Separator draws a native horizontal or vertical divider. By itself it has nothing to divide, so use it in a Box with controls such as Labels. The runnable example shows both orientations.
Appearance
Runnable example
require "uing"
UIng.init
window = UIng::Window.new("Separator Example", 360, 160, margined: true)
window.on_closing do
UIng.quit
true
end
box = UIng::Box.new(:vertical, padded: true)
box.append(UIng::Label.new("Above the separator"), stretchy: false)
box.append(UIng::Separator.new(:horizontal), stretchy: false)
row = UIng::Box.new(:horizontal, padded: true)
row.append(UIng::Label.new("Left of the separator"))
row.append(UIng::Separator.new(:vertical), stretchy: false)
row.append(UIng::Label.new("Right of the separator"))
box.append(row)
window.child = box
window.show
UIng.main
UIng.uninit
Usage notes
- Construct it with
:horizontalor:vertical. The typedUIng::Orientationvalues are also accepted. - Place a vertical separator inside a horizontal Box and a horizontal separator inside a vertical Box.
- Place Labels or other controls on either side to visually separate related groups.


