atk.Component
Prev | The atk Class Reference | Next

## atk.Component

atk.Component — the ATK interface provided by UI components that occupy a physical area on the screen.

## Synopsis

    class atk.Component(gobject.GInterface):
        def contains(x, y, coord_type)
        def ref_accessible_at_point(x, y, coord_type)
        def get_extents(coord_type)
        def get_position(coord_type)
        def get_size()
        def grab_focus()
        def remove_focus_handler(handler_id)
        def set_extents(x, y, width, height, coord_type)
        def set_position(x, y, coord_type)
        def set_size(width, height)
        def get_layer()
        def get_mdi_zorder()

## atk.Component Signal Prototypes

"bounds-changed" | `def callback(`atkcomponent`, `rect`, `user_param1`, `...`)`

## Description

`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`.

## Methods

### atk.Component.contains

        def contains(x, y, coord_type)

`x` : | x coordinate
`y` : | y coordinate
`coord_type` : | specifies whether the coordinates are relative to the screen or to the components top level window - one of the Atk Coord Type Constants
Returns : | `True` or `False` indicating whether the specified point is within the extent of the component or not

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

### atk.Component.ref_accessible_at_point

        def ref_accessible_at_point(x, y, coord_type)

`x` : | x coordinate
`y` : | y coordinate
`coord_type` : | specifies whether the coordinates are relative to the screen or to the components top level window - one of the Atk Coord Type Constants
Returns : | an `atk.Object` reference to the accessible child, if one exists

Gets a reference to the accessible child, if one exists, at the coordinate point specified by `x` and `y`.

### atk.Component.get_extents

        def get_extents(coord_type)

`coord_type` : | specifies whether the coordinates are relative to the screen or to the components top level window - one of the Atk Coord Type Constants
Returns : | a 4-tuple containing the x, y position coordinates and the width and height of the component.

Gets the rectangle which gives the extent of the component.

### atk.Component.get_position

        def get_position(coord_type)

`coord_type` : | specifies whether the coordinates are relative to the screen or to the components top level window - one of the Atk Coord Type Constants
Returns : | a 2-tuple containing the x, y position coordinates of the component.

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

### atk.Component.get_size

        def get_size()

Returns : | a 2-tuple containing the width and height of the component.

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

### atk.Component.grab_focus

        def grab_focus()

Returns : | `True` if successful, `False` otherwise.

Grabs focus for this component.

### atk.Component.remove_focus_handler

        def remove_focus_handler(handler_id)

`handler_id` : | the handler id of the focus handler to be removed from component

Remove the handler specified by `handler_id` from the list of functions to be executed when this object receives focus events (in or out).

### atk.Component.set_extents

        def set_extents(x, y, width, height, coord_type)

`x` : | x coordinate
`y` : | y coordinate
`width` : | width to set for the component
`height` : | height to set for the component
`coord_type` : | specifies whether the coordinates are relative to the screen or to the components top level window - one of the Atk Coord Type Constants
Returns : | `True` if the extents were set

Sets the extents of the component.

### atk.Component.set_position

        def set_position(x, y, coord_type)

`x` : | x coordinate
`y` : | y coordinate
`coord_type` : | specifies whether the coordinates are relative to the screen or to the components top level window - one of the Atk Coord Type Constants
Returns : | `True` if the position was set

Sets the postition of the component.

### atk.Component.set_size

        def set_size(width, height)

`width` : | width to set for component
`height` : | height to set for component
Returns : | `True` if the size was set

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

### atk.Component.get_layer

        def get_layer()

Returns : | one of the Atk Layer Constants which is the layer of the component

Gets the layer of the component.

### atk.Component.get_mdi_zorder

        def get_mdi_zorder()

Returns : | an integer 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.

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`.

## Signals

### The "bounds-changed" atk.Component Signal

        def callback(atkcomponent, rect, user_param1, ...)

`atkcomponent` : | the object which received the signal.
`rect` : | The `atk.Rectangle` giving the new position and size.
`user_param1` : | the first user parameter (if any) specified with the `connect`() method
`...` : | additional user parameters (if any)

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

Prev | Up | Next
atk.Action | Home | atk.Document