GOffice.Canvas¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.Layout (10), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Gtk.Layout (2), Gtk.Container (3), Gtk.Widget (39), Gtk.Scrollable (4)
Child Properties¶
- Inherited:
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
base |
r |
||
cur_event |
r |
||
direction |
r |
||
document |
r |
||
grabbed_item |
r |
||
height |
r |
||
last_item |
r |
||
pixels_per_unit |
r |
||
priv |
r |
||
root |
r |
||
scroll_x1 |
r |
||
scroll_y1 |
r |
||
width |
r |
Class Details¶
- class GOffice.Canvas(**kwargs)¶
- Bases:
- Abstract:
No
- c2w(x, y, x_, y_)¶
- Parameters:
Retrieves the position in the widget given the canvas coordinates.
- get_direction()¶
- Returns:
the current canvas direction.
- Return type:
- get_document()¶
- Returns:
The
GOffice.Doc
associated with theGOffice.Canvas
.- Return type:
- get_grabbed_item()¶
- Returns:
The currently grabbed
GOffice.CanvasItem
.- Return type:
- get_item_at(x, y)¶
- Parameters:
- Returns:
the
GOffice.CanvasItem
displayed at (x,`y`) if any.- Return type:
- get_pixels_per_unit()¶
- Returns:
how many pixels are used for each unit when displaying the canvas.
- Return type:
- get_realized()¶
- Returns:
True
if the canvas has been realized as aGtk.Widget
.- Return type:
- get_root()¶
- Returns:
the top level item of self, always a
GOffice.CanvasGroup
.- Return type:
- get_scroll_position(x, y)¶
- Parameters:
Retrieves the origin of the visible region of the canvas.
- grab_item(item)¶
- Parameters:
item (
GOffice.CanvasItem
) –GOffice.CanvasItem
Grabs
GOffice.CanvasItem
. All subsequent events will be passed toGOffice.CanvasItem
. This function fails if an item is already grabbed.
- invalidate(x0, y0, x1, y1)¶
- Parameters:
x0 (
float
) – minimum x coordinate of the invalidated region in canvas coordinatesy0 (
float
) – minimum y coordinate of the invalidated region in canvas coordinatesx1 (
float
) – maximum x coordinate of the invalidated region in canvas coordinatesy1 (
float
) – maximum y coordinate of the invalidated region in canvas coordinates
Invalidates a region of the canvas. The canvas will be redrawn only if the invalidated region intersects the visible area.
- invalidate_region(item, region)¶
- Parameters:
item (
GOffice.CanvasItem
) – the item to redrawregion (
cairo.Region
) – the region to redraw
Invalidates a region of the canvas. Only item will be redrawn if the next draw event is called with a cairo contest clipped to region. Used in gnumeric for the walking ants cursor.
- render(cr, x0, y0, x1, y1)¶
- Parameters:
cr (
cairo.Context
) –x0 (
float
) –y0 (
float
) –x1 (
float
) –y1 (
float
) –
- scroll_to(x, y)¶
-
Scrolls the canvas so that the origin of the visible region is at (x,`y`). The origin position depends on the canvas direction (see
GOffice.CanvasDirection
).
- set_direction(direction)¶
- Parameters:
direction (
GOffice.CanvasDirection
) –GOffice.CanvasDirection
Sets the direction used by the canvas.
- set_document(document)¶
- Parameters:
document (
GOffice.Doc
) –GOffice.Doc
Associates the
GOffice.Doc
with theGOffice.Canvas
. This is needed to use images when filling styled items (seeGOffice.CanvasStyledItem
).
- set_pixels_per_unit(pixels_per_unit)¶
- Parameters:
pixels_per_unit (
float
) – the new scale
Sets the scale as the number of pixels used for each unit when displaying the canvas.
- ungrab_item()¶
Ungrabs the currently grabbed
GOffice.CanvasItem
. This function fails if no item is grabbed.
- w2c(x, y, x_, y_)¶
- Parameters:
Retrieves the canvas coordinates given the position in the widget.