Class: Iup::HBox

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

Overview

A container for one or more child widgets, arranged in a horizontal row.

Example

The following example puts a label beside a button:

box = Iup::HBox.new(label, button) do |b|
b.gap = 10
b.margin = '5x5'
b.expand = :yes
end

Also see: Fill, VBox

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| ... } ⇒ HBox

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

  • widgets - one or more child widgets

Yields:

  • (_self)

Yield Parameters:

  • _self (Iup::HBox)

    the object that the method was called on



25
26
27
28
29
30
# File 'lib/wrapped/hbox.rb', line 25

def initialize *widgets
  @handle = IupLib.IupHbox(*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, 'atop' / 'acenter' / 'abottom'



37
# File 'lib/wrapped/hbox.rb', line 37

define_attribute :alignment

#clientoffsetObject

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



42
# File 'lib/wrapped/hbox.rb', line 42

define_reader :clientoffset

#clientsizeObject

:attr_reader: clientsize returns current size of box as "widthxheight".



47
# File 'lib/wrapped/hbox.rb', line 47

define_reader :clientsize

#expandObject

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



53
# File 'lib/wrapped/hbox.rb', line 53

define_attribute :expand

#expandchildrenObject

:attr: expandchildren Set to allow children to expand in vertical direction, values as 'yes' / 'no'.



58
# File 'lib/wrapped/hbox.rb', line 58

define_attribute :expandchildren

#gapObject

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



63
# File 'lib/wrapped/hbox.rb', line 63

define_attribute :gap

#homogeneousObject

:attr: homogeneous Set to force all children to get equal horizontal space, values as 'yes' / 'no'.



68
# File 'lib/wrapped/hbox.rb', line 68

define_attribute :homogeneous

#marginObject

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



73
# File 'lib/wrapped/hbox.rb', line 73

define_attribute :margin

#normalizesizeObject

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



78
# File 'lib/wrapped/hbox.rb', line 78

define_attribute :normalizesize

#positionObject

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



83
# File 'lib/wrapped/hbox.rb', line 83

define_reader :position

#rastersizeObject

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



88
# File 'lib/wrapped/hbox.rb', line 88

define_attribute :rastersize