class Iup::Expander
An expandable container for a single widget. The user can show or hide the child widget, as required.
Attributes¶ ↑
- autoshow
-
If set, child will be shown when mouse hovers over container. Values 'yes' / 'no'.
- backcolor
-
Colour of background in title area, as “r g b”.
- barposition
-
Position of expander bar, as 'top' / 'bottom' / 'left' / 'right'.
- barsize
-
n, size of bar - defaults to text line height + 5.
- 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'.
- forecolor
-
Colour of text in title area, as “r g b”.
- position
-
read-only returns position in pixels within client window as “x,y”.
- rastersize
-
Size of the container, in pixels, value as “widthxheight”.
- state
-
Show or hide child, as 'open' / 'close'.
- title
-
Displayed on box in title area.
Public Class Methods
Creates an instance of the Expander
.
- child
-
the child widget
- block
-
optional block to set up the container's attributes.
# File lib/wrapped/expander.rb, line 30 def initialize child, &block @handle = IupLib.IupExpander child.handle self.instance_eval &block if block_given? end
Public Instance Methods
Action generated after the expander state is interactively changed.
- callback
-
a zero-argument procedure
# File lib/wrapped/expander.rb, line 55 def action_cb callback unless callback.arity.zero? raise ArgumentError, 'action_cb callback must take 0 arguments' end cb = Proc.new do |ih| callback.call end define_callback cb, 'ACTION_CB', :plain end