Class: Iup::ZBox
- Includes:
- DynamicFillMethods
- Defined in:
- lib/wrapped/zbox.rb
Overview
A container of a list of widgets, but only displays one of them.
Example
The following example stores four widgets and displays the label:
zbox = Iup::ZBox.new(frame, text, label, ) do |b|
b.alignment = 'acenter'
b. = 'yes'
b.valuepos = 2
end
Also see: HBox, Tabs, VBox
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#alignment ⇒ Object
:attr: alignment alignment of visible child.
-
#clientoffset ⇒ Object
:attr_reader: clientoffset returns current offset of box in its client as “widthxheight”.
-
#clientsize ⇒ Object
:attr_reader: clientsize returns current size of box as “widthxheight”.
-
#expand ⇒ Object
:attr: expand Allows container to fill available space in indicated direction.
-
#initialize(*widgets) {|_self| ... } ⇒ ZBox
constructor
Creates a new instance.
-
#rastersize ⇒ Object
:attr: rastersize Size of the container, in pixels, value as “widthxheight”.
-
#size ⇒ Object
:attr: size Size of the container, in character units, value as “widthxheight”.
-
#valuepos ⇒ Object
–.
-
#valuepos=(val) ⇒ Object
:nodoc:.
Methods included from DynamicFillMethods
Methods inherited from Widget
#active, #assign_handle, #bgcolor, #destroy, #enterwindow_cb=, #fgcolor, #font, #getfocus_cb=, #help_cb=, #k_any=, #killfocus_cb=, #leavewindow_cb=, #map_cb=, #maxsize, #minsize, #open_controls, #unmap_cb=, #visible, #wid, #zorder
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_reader, #define_id_writer, #define_property_attribute, #define_property_reader, #define_property_writer, #define_reader, #define_writer
Methods included from CallbackSetter
Constructor Details
#initialize(*widgets) {|_self| ... } ⇒ ZBox
Creates a new instance. If a block is given, the new instance is yielded to it.
-
widgets- one or more child widgets
25 26 27 28 29 30 |
# File 'lib/wrapped/zbox.rb', line 25 def initialize * @handle = IupLib.IupZbox(*()) # run any provided block on instance, to set up further attributes yield self if block_given? end |
Instance Method Details
#alignment ⇒ Object
:attr: alignment alignment of visible child. Values: ‘north’ / ‘south’ / ‘east’ / ‘west’/ ‘ne’ / ‘nw’ / ‘se’ / ‘sw’ / ‘acenter’
51 |
# File 'lib/wrapped/zbox.rb', line 51 define_attribute :alignment |
#clientoffset ⇒ Object
:attr_reader: clientoffset returns current offset of box in its client as “widthxheight”.
56 |
# File 'lib/wrapped/zbox.rb', line 56 define_reader :clientoffset |
#clientsize ⇒ Object
:attr_reader: clientsize returns current size of box as “widthxheight”.
61 |
# File 'lib/wrapped/zbox.rb', line 61 define_reader :clientsize |
#expand ⇒ Object
:attr: expand Allows container to fill available space in indicated direction. Values ‘no’ / ‘horizontal’ / ‘vertical’ / ‘yes’.
67 |
# File 'lib/wrapped/zbox.rb', line 67 define_attribute :expand |
#rastersize ⇒ Object
:attr: rastersize Size of the container, in pixels, value as “widthxheight”.
72 |
# File 'lib/wrapped/zbox.rb', line 72 define_attribute :rastersize |
#size ⇒ Object
:attr: size Size of the container, in character units, value as “widthxheight”.
77 |
# File 'lib/wrapped/zbox.rb', line 77 define_attribute :size |
#valuepos ⇒ Object
–
39 40 41 |
# File 'lib/wrapped/zbox.rb', line 39 def valuepos IupLib.IupGetAttribute(@handle, 'VALUEPOS').first.to_i end |
#valuepos=(val) ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/wrapped/zbox.rb', line 43 def valuepos= val # :nodoc: IupLib.IupSetAttribute(@handle, 'VALUEPOS', val.to_s) end |