Class: Iup::Frame

Inherits:
Widget show all
Defined in:
lib/wrapped/frame.rb

Overview

A frame contains a child widget and displays it with a border. Optionally, the frame can have a text title.

Example

Example placing a text label on widgets placed into a HBox:

Iup::Frame.new(hbox) do |f|
  f.title = 'ALIGNMENT=ALEFT, GAP=10'
end

Instance Attribute Summary

Attributes inherited from Widget

#handle

Instance Method Summary collapse

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(widget) {|_self| ... } ⇒ Frame

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

  • widget - the child widget to display.

Yields:

  • (_self)

Yield Parameters:

  • _self (Iup::Frame)

    the object that the method was called on



19
20
21
22
23
24
# File 'lib/wrapped/frame.rb', line 19

def initialize widget
  @handle = IupLib.IupFrame(widget.handle)

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

Instance Method Details

#clientoffsetObject

:attr_reader: clientoffset Returns current offset of frame in its client as “widthxheight”.



31
# File 'lib/wrapped/frame.rb', line 31

define_reader :clientoffset

#clientsizeObject

:attr_reader: clientsize Returns current size of frame as “widthxheight”.



36
# File 'lib/wrapped/frame.rb', line 36

define_reader :clientsize

#expandObject

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



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

define_attribute :expand

#positionObject

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



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

define_reader :position

#rastersizeObject

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



52
# File 'lib/wrapped/frame.rb', line 52

define_attribute :rastersize

#screenpositionObject

:attr_reader: screenposition returns position in pixels on screen as “x,y”.



57
# File 'lib/wrapped/frame.rb', line 57

define_reader :screenposition

#sunkenObject

:attr: sunken For frame with no title, gives a sunken appearance if set: values as ‘yes’ / ‘no’.



62
# File 'lib/wrapped/frame.rb', line 62

define_attribute :sunken

#titleObject

:attr: title Text displayed as frame title.



67
# File 'lib/wrapped/frame.rb', line 67

define_attribute :title