Class: Iup::VBox

Inherits:
Widget show all
Includes:
DynamicFillMethods
Defined in:
lib/wrapped/vbox.rb

Overview

A container for one or more child widgets, arranged in a vertical column.

Example

This example arranges three buttons vertically with equal width, and some spacing:

box = Iup::VBox.new(button1, button2, button3) do |b|
  b.gap = 10
  b.margin = '5x5'
  b.expandchildren = :yes
end

Also see: Fill, HBox

Instance Attribute Summary

Attributes inherited from Widget

#handle

Instance Method Summary collapse

Methods included from DynamicFillMethods

#append, #insert

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, #size, #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

#define_callback

Constructor Details

#initialize(*widgets) {|_self| ... } ⇒ VBox

Creates an instance of the vbox. If a block is given, the new instance is yielded to it.

  • widgets - one or more child widgets

Yields:

  • (_self)

Yield Parameters:

  • _self (Iup::VBox)

    the object that the method was called on



26
27
28
29
30
31
# File 'lib/wrapped/vbox.rb', line 26

def initialize *widgets
  @handle = IupLib.IupVbox(*widget_list(widgets))

  # run any provided block on instance, to set up further attributes
  yield self if block_given?
end

Instance Method Details

#alignmentObject

:attr: alignment horizontal alignment of children, ‘aleft’ / ‘acenter’ / ‘aright’



38
# File 'lib/wrapped/vbox.rb', line 38

define_attribute :alignment

#clientoffsetObject

:attr_reader: clientoffset returns current offset of box in its client as “widthxheight”.



43
# File 'lib/wrapped/vbox.rb', line 43

define_reader :clientoffset

#clientsizeObject

:attr_reader: clientsize returns current size of box as “widthxheight”.



48
# File 'lib/wrapped/vbox.rb', line 48

define_reader :clientsize

#expandObject

:attr: expand Allows container to fill available space in indicated direction. Values ‘no’ / ‘horizontal’ / ‘vertical’ / ‘yes’.



54
# File 'lib/wrapped/vbox.rb', line 54

define_attribute :expand

#expandchildrenObject

:attr: expandchildren Set to allow children to expand fully in horizontal direction, values as ‘yes’ / ‘no’.



60
# File 'lib/wrapped/vbox.rb', line 60

define_attribute :expandchildren

#gapObject

:attr: gap Number of pixels between children, default value of 0.



65
# File 'lib/wrapped/vbox.rb', line 65

define_attribute :gap

#homogeneousObject

:attr: homogeneous Set to force all children to get equal vertical size, values as ‘yes’ / ‘no’.



71
# File 'lib/wrapped/vbox.rb', line 71

define_attribute :homogeneous

#marginObject

:attr: margin Margin in x and y directions, value as “mxn”.



76
# File 'lib/wrapped/vbox.rb', line 76

define_attribute :margin

#normalizesizeObject

:attr: normalsize Set to make natural size of children same, values as ‘yes’ / ‘no’.



81
# File 'lib/wrapped/vbox.rb', line 81

define_attribute :normalizesize

#positionObject

:attr_reader: position returns position in pixels within client window as “x,y”.



86
# File 'lib/wrapped/vbox.rb', line 86

define_reader :position

#rastersizeObject

:attr: rastersize Size of the container, in pixels, value as “widthxheight”.



91
# File 'lib/wrapped/vbox.rb', line 91

define_attribute :rastersize