goocanvas.Style — Support for cascading style properties for canvas items.
goocanvas.Style extends, gobject.GObject {goocanvas.Style();copy();get_parent();get_style_property(property_id);set_fill_options(cr);set_parent(parent);set_stroke_options(cr);set_style_property(property_id,
value);
}
goocanvas.Style
provides support for cascading style properties for canvas items.
It is intended to be used when implementing new canvas items.
Style properties are identified by a unique GQuark, and contain arbitrary data stored in a GValue.
goocanvas.Style
also provides a few convenience functions such as
set_stroke_options
and set_fill_options
which efficiently apply an item's standard style properties to the given cairo_t.
convert_from_item_scopypace();
Returns : | A copy of the given
goocanvas.Style |
Copies the given goocanvas.Style,
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. |
Gets the parent of the style.
get_style_property(property_id);
| The property identifier. |
Returns : | The property value, or None if it isn't set. |
Gets the value of a property.
This searches though all the goocanvas.Style's
own list of property settings and also all ancestor
goocanvas.Style objects.
set_fill_options(cr);
| A cairo context. |
Returns : | True if a paint source is set, or False if the fill should be skipped. |
Sets the standard cairo fill options using the given style.
set_stroke_options(cr);
| A cairo context. |
Returns : | True if a paint source is set, or False if the stroke should be skipped. |
Sets the standard cairo stroke options using the given style.
set_style_property(property_id,
value);
| the property identifier. |
| 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.Style objects.