Class: Iup::SplitBox
Overview
A container for two child widgets, with a moveable divider between them. Note that moving the divider cannot affect other widgets.
Attributes
- autohide
-
If set, hides a child if the child client area is smaller than the bar size. Values ‘yes’ / ‘no’.
- barsize
-
Controls the size of the bar handler, defaults to 5.
- color
-
Colour of the bar grip, as “r g b”.
- expand
-
Allows container to fill available space in indicated direction. Values ‘no’ / ‘horizontal’ / ‘vertical’ / ‘yes’.
- layoutdrag
-
Updates the children’s layout when bar moved automatically. Values ‘yes’ / ‘no’.
- orientation
-
Bar handler can be either ‘horizontal’ or ‘vertical’.
- position
-
read-only returns position in pixels within client window as “x,y”.
- rastersize
-
Size of the container, in pixels, value as “widthxheight”.
- showgrip
-
If set, shows the bar grip. Values ‘yes’ / ‘no’.
- value
-
0 <= n <= 1000 sets the proportion of the left/top area relative to whole.
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#initialize(child1, child2, &block) ⇒ SplitBox
constructor
Creates an instance of the SplitBox.
Methods inherited from Widget
#assign_handle, #enterwindow_cb, #getfocus_cb, #help_cb, #k_any, #killfocus_cb, #leavewindow_cb, #map_cb, #open_controls, #unmap_cb
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_readonly, #define_id_writeonly, #define_property_attribute, #define_property_writeonly, #define_readonly, #define_writeonly
Methods included from CallbackSetter
Constructor Details
#initialize(child1, child2, &block) ⇒ SplitBox
Creates an instance of the SplitBox.
- child1
-
the left or top child widget
- child2
-
the right or bottom child widget
- block
-
optional block to set up the box’s attributes.
29 30 31 32 33 34 |
# File 'lib/wrapped/splitbox.rb', line 29 def initialize child1, child2, &block @handle = IupLib.IupSplit child1.handle, child2.handle # run any provided block on instance, to set up further attributes self.instance_eval &block if block_given? end |