GooCanvas.CanvasStyle¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
the parent style. |
|
parent_object |
r |
||
properties |
[ |
r |
an array of |
Class Details¶
- class GooCanvas.CanvasStyle(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GooCanvas.CanvasStyleprovides support for cascading style properties for canvas items. It is intended to be used when implementing new canvas items.The cascading styles canvas feature may be removed in a future version of
GooCanvas.Canvas.Style properties are identified by a unique #GQuark, and contain arbitrary data stored in a
GObject.Value.GooCanvas.CanvasStylealso provides a few convenience functions such asGooCanvas.CanvasStyle.set_stroke_options() andGooCanvas.CanvasStyle.set_fill_options() which efficiently apply an item’s standard style properties to the givencairo.Context.- classmethod new()¶
- Returns:
a new
GooCanvas.CanvasStyle.- Return type:
Creates a new
GooCanvas.CanvasStyle.
- copy()¶
- Returns:
a copy of the given
GooCanvas.CanvasStyle.- Return type:
Copies the given
GooCanvas.CanvasStyle, by copying all of its properties. Though the parent of the new style is left unset.
- get_parent()¶
- Returns:
the parent of the given style, or
None.- Return type:
Gets the parent of the style.
- get_property(property_id)¶
- Parameters:
property_id (
int) – the property identifier.- Returns:
the property value, or
Noneif it isn’t set.- Return type:
Gets the value of a property.
This searches though all the
GooCanvas.CanvasStyle's own list of property settings and also all ancestorGooCanvas.CanvasStyleobjects.Note that it returns a pointer to the internal
GObject.Valuesetting, which should not be changed.
- set_fill_options(cr)¶
- Parameters:
cr (
cairo.Context) – a cairo context.- Returns:
Trueif a paint source is set, orFalseif the fill should be skipped.- Return type:
Sets the standard cairo fill options using the given style.
- set_parent(parent)¶
- Parameters:
parent (
GooCanvas.CanvasStyle) – the new parent.
Sets the parent of the style.
- set_property(property_id, value)¶
- Parameters:
property_id (
int) – the property identifier.value (
GObject.Value) – the value of the property.
Sets a property in the style, replacing any current setting.
Note that this will override the property setting in ancestor
GooCanvas.CanvasStyleobjects.
- set_stroke_options(cr)¶
- Parameters:
cr (
cairo.Context) – a cairo context.- Returns:
Trueif a paint source is set, orFalseif the stroke should be skipped.- Return type:
Sets the standard cairo stroke options using the given style.