GooCanvas.CanvasItemIface

Fields

Name

Type

Access

Description

add_child

object

r

adds a child.

allocate_area

object

r

allocates the item’s area, in its parent’s coordinate space. The item must recalculate its bounds and request redraws of parts of the canvas if necessary. This is only used for items in layout containers such as GooCanvas.CanvasTable.

animation_finished

object

r

signal emitted when the item’s animation has finished.

base_iface

GObject.TypeInterface

r

button_press_event

object

r

signal emitted when a mouse button is pressed within the item.

button_release_event

object

r

signal emitted when a mouse button is released.

child_notify

object

r

signal emitted when a child property is changed.

enter_notify_event

object

r

signal emitted when the mouse enters the item.

focus_in_event

object

r

signal emitted when the item receices the keyboard focus.

focus_out_event

object

r

signal emitted when the item loses the keyboard focus.

get_bounds

object

r

gets the bounds of the item.

get_canvas

object

r

returns the canvas the item is in.

get_child

object

r

returns the child at the given index.

get_child_property

object

r

gets a child property of a given child item, e.g. the “row” or “column” property of an item in a GooCanvas.CanvasTable.

get_is_static

object

r

returns True if the item is static.

get_items_at

object

r

gets all the items at the given point.

get_model

object

r

gets the model that the canvas item is viewing.

get_n_children

object

r

returns the number of children of the item.

get_parent

object

r

gets the item’s parent.

get_requested_area

object

r

returns the requested area of the item, in its parent’s coordinate space. This is only used for items in layout containers such as GooCanvas.CanvasTable.

get_requested_area_for_width

object

r

returns the requested bounds of the item, given a particular allocated width, using the parent’s coordinate space.

get_requested_height

object

r

returns the requested height of the item, given a particular allocated width, using the parent’s coordinate space. Note that this method should only be used if the position of the item remains unchanged. If the position might change use get_requested_area_for_width() instead.

get_style

object

r

gets the item’s style.

get_transform

object

r

gets the item’s transformation matrix.

get_transform_for_child

object

r

gets the transform used to lay out a given child.

grab_broken_event

object

r

signal emitted when a grab that the item has is lost.

is_visible

object

r

returns True if the item is currently visible.

key_press_event

object

r

signal emitted when a key is pressed.

key_release_event

object

r

signal emitted when a key is released.

leave_notify_event

object

r

signal emitted when the mouse leaves the item.

motion_notify_event

object

r

signal emitted when the mouse moves within the item.

move_child

object

r

moves a child up or down the stacking order.

paint

object

r

renders the item to the given cairo context.

query_tooltip

object

r

signal emitted to query the tooltip of an item.

remove_child

object

r

removes a child.

request_update

object

r

requests that an update is scheduled.

scroll_event

object

r

signal emitted when the mouse wheel is activated within the item.

set_canvas

object

r

sets the canvas the item is in.

set_child_property

object

r

sets a child property for a given child item.

set_is_static

object

r

notifies the item whether it is static or not.

set_model

object

r

sets the model that the canvas item will view.

set_parent

object

r

sets the item’s parent.

set_style

object

r

sets the item’s style.

set_transform

object

r

sets the item’s transformation matrix.

update

object

r

updates the item, if needed. It recalculates the bounds of the item and requests redraws of parts of the canvas if necessary.

Methods

None

Details

class GooCanvas.CanvasItemIface

#GooCanvasItemIFace holds the virtual methods that make up the GooCanvas.CanvasItem interface.

Simple canvas items only need to implement the get_parent(), set_parent(), get_bounds(), get_items_at(), update() and paint() methods (and also get_requested_area() and allocate_area() if they are going to be used inside a layout container like GooCanvas.CanvasTable).

Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style().

Container items must implement get_canvas(), set_canvas(), get_n_children(), get_child() and request_update(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvas.CanvasTable may implement get_child_property(), set_child_property() and get_transform_for_child().