class Iup::ZBox

A ZBox is a container class, which stores a list of widgets but only displays one of them.

Attributes

alignment

alignment of visible child. Values: 'north' / 'south' / 'east' / 'west'/ 'ne' / 'nw' / 'se' / 'sw' / 'acenter'

clientoffset

read-only, returns current offset of box in its client as “widthxheight”.

clientsize

read-only, returns current size of box as “widthxheight”.

expand

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

gap

Number of pixels between children, default value of 0.

rastersize

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

size

Size of the container, in character units, value as “widthxheight”.

Public Class Methods

new(*widgets, &block) click to toggle source

Creates an instance of the ZBox.

*widgets

one or more child widgets

block

optional block to set up the box's attributes.

# File lib/wrapped/zbox.rb, line 26
def initialize *widgets, &block
  @handle = IupLib.IupZbox *widget_list(widgets)

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

Public Instance Methods

valuepos(val=nil?) click to toggle source

Returns the visible child, accessed by its index position.

# File lib/wrapped/zbox.rb, line 36
def valuepos val=nil? 
  if val.nil?
    result = IupLib.IupGetAttribute(@handle, 'VALUEPOS').first
    result.to_i
  else
    IupLib.IupSetAttribute @handle, 'VALUEPOS', (val.to_i - 1).to_s
  end
end