Next: , Previous: AtkAction, Up: Top


3 AtkComponent

The ATK interface provided by UI components which occupy a physical area on the screen.

3.1 Overview

<atk-component> should be implemented by most if not all UI elements with an actual on-screen presence, i.e. components which can be said to have a screen-coordinate bounding box. Virtually all widgets will need to have <atk-component> implementations provided for their corresponding <atk-object> class. In short, only UI elements which are *not* GUI elements will omit this ATK interface.

A possible exception might be textual information with a transparent background, in which case text glyph bounding box information is provided by <atk-text>.

3.2 Usage

— Class: <atk-component>

Derives from <ginterface>.

This class defines no direct slots.

— Signal on <atk-component>: bounds-changed (arg0 <atk-rectangle>)

The 'bounds-changed" signal is emitted when the bposition or size of the a component changes.

— Function: atk-component-contains (self <atk-component>) (int) (int) (coord_type <atk-coord-type>) ⇒  (ret bool)
— Method: contains

Checks whether the specified point is within the extent of the component.

component
the <atk-component>
x
x coordinate
y
y coordinate
coord-type
specifies whether the coordinates are relative to the screen or to the components top level window
ret
#t’ or ‘#f’ indicating whether the specified point is within the extent of the component or not
— Function: atk-component-get-extents (self <atk-component>) (coord_type <atk-coord-type>) ⇒  (int) (int) (width int) (height int)
— Method: get-extents

Gets the rectangle which gives the extent of the component.

component
an <atk-component>
x
address of <gint> to put x coordinate
y
address of <gint> to put y coordinate
width
address of <gint> to put width
height
address of <gint> to put height
coord-type
specifies whether the coordinates are relative to the screen or to the components top level window
— Function: atk-component-get-layer (self <atk-component>) ⇒  (ret <atk-layer>)
— Method: get-layer

Gets the layer of the component.

component
an <atk-component>
ret
an <atk-layer> which is the layer of the component
— Function: atk-component-get-mdi-zorder (self <atk-component>) ⇒  (ret int)
— Method: get-mdi-zorder

Gets the zorder of the component. The value G_MININT will be returned if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW.

component
an <atk-component>
ret
a gint which is the zorder of the component, i.e. the depth at which the component is shown in relation to other components in the same container.
— Function: atk-component-get-position (self <atk-component>) (coord_type <atk-coord-type>) ⇒  (int) (int)
— Method: get-position

Gets the position of component in the form of a point specifying component's top-left corner.

component
an <atk-component>
x
address of <gint> to put x coordinate position
y
address of <gint> to put y coordinate position
coord-type
specifies whether the coordinates are relative to the screen or to the components top level window
— Function: atk-component-get-size (self <atk-component>) ⇒  (width int) (height int)
— Method: get-size

Gets the size of the component in terms of width and height.

component
an <atk-component>
width
address of <gint> to put width of component
height
address of <gint> to put height of component
— Function: atk-component-grab-focus (self <atk-component>) ⇒  (ret bool)
— Method: grab-focus

Grabs focus for this component.

component
an <atk-component>
ret
#t’ if successful, ‘#f’ otherwise.
— Function: atk-component-set-extents (self <atk-component>) (int) (int) (width int) (height int) (coord_type <atk-coord-type>) ⇒  (ret bool)
— Method: set-extents

Sets the extents of component.

component
an <atk-component>
x
x coordinate
y
y coordinate
width
width to set for component
height
height to set for component
coord-type
specifies whether the coordinates are relative to the screen or to the components top level window
ret
#t’ or ‘#f’ whether the extents were set or not
— Function: atk-component-set-position (self <atk-component>) (int) (int) (coord_type <atk-coord-type>) ⇒  (ret bool)
— Method: set-position

Sets the postition of component.

component
an <atk-component>
x
x coordinate
y
y coordinate
coord-type
specifies whether the coordinates are relative to the screen or to the components top level window
ret
#t’ or ‘#f’ whether or not the position was set or not
— Function: atk-component-set-size (self <atk-component>) (width int) (height int) ⇒  (ret bool)
— Method: set-size

Set the size of the component in terms of width and height.

component
an <atk-component>
width
width to set for component
height
height to set for component
ret
#t’ or ‘#f’ whether the size was set or not
— Function: atk-component-get-alpha (self <atk-component>) ⇒  (ret double)
— Method: get-alpha

Returns the alpha value (i.e. the opacity) for this component, on a scale from 0 (fully transparent) to 1.0 (fully opaque).

component
an <atk-component>
ret
An alpha value from 0 to 1.0, inclusive.

Since ATK 1.12