goocanvas.Style — Support for cascading style properties for canvas items.
class goocanvas.Style(gobject.GObject): |
+-- gobject.GObject +-- goocanvas.Style
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.
def 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.
def get_parent()
Returns : | The parent of the given style, or None. |
Gets the parent of the style.
def get_style_property(property_id)
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.
def set_fill_options(cr)
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.
def set_parent(parent)
parent : | The new parent |
Sets the parent of the style.
def set_stroke_options(cr)
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.
def set_style_property(property_id, value)
property_id : | the property identifier. |
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.Style objects.