Gtk.StyleProperties

g GObject.GInterface GObject.GInterface Gtk.StyleProvider Gtk.StyleProvider GObject.GInterface->Gtk.StyleProvider GObject.Object GObject.Object Gtk.StyleProperties Gtk.StyleProperties GObject.Object->Gtk.StyleProperties Gtk.StyleProvider->Gtk.StyleProperties

Subclasses:None

Methods

Inherited:GObject.Object (37), Gtk.StyleProvider (3)
Structs:GObject.ObjectClass (5)
class new ()
  clear ()
  get_property (property, state)
  lookup_color (name)
  map_color (name, color)
  merge (props_to_merge, replace)
  set_property (property, state, value)
  unset_property (property, state)

Virtual Methods

Inherited:GObject.Object (7), Gtk.StyleProvider (3)

Properties

None

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent_object GObject.Object r  

Class Details

class Gtk.StyleProperties(**kwargs)
Bases:GObject.Object, Gtk.StyleProvider
Abstract:No
Structure:Gtk.StylePropertiesClass

Gtk.StyleProperties provides the storage for style information that is used by Gtk.StyleContext and other Gtk.StyleProvider implementations.

Before style properties can be stored in Gtk.StyleProperties, they must be registered with gtk_style_properties_register_property().

Unless you are writing a Gtk.StyleProvider implementation, you are unlikely to use this API directly, as gtk_style_context_get() and its variants are the preferred way to access styling information from widget implementations and theming engine implementations should use the APIs provided by Gtk.ThemingEngine instead.

Gtk.StyleProperties has been deprecated in GTK 3.16. The CSS machinery does not use it anymore and all users of this object have been deprecated.

classmethod new()[source]
Returns:a new Gtk.StyleProperties
Return type:Gtk.StyleProperties

Returns a newly created Gtk.StyleProperties

Deprecated since version 3.16: Gtk.StyleProperties are deprecated.

clear()[source]

Clears all style information from self.

Deprecated since version 3.16: Gtk.StyleProperties are deprecated.

get_property(property, state)[source]
Parameters:
  • property (str) – style property name
  • state (Gtk.StateFlags) – state to retrieve the property value for
Returns:

True if the property exists in self, False otherwise

value:return location for the style property value.

Return type:

(bool, value: GObject.Value)

Gets a style property from self for the given state. When done with value, GObject.Value.unset() needs to be called to free any allocated memory.

New in version 3.0.

Deprecated since version 3.16: Gtk.StyleProperties are deprecated.

lookup_color(name)[source]
Parameters:name (str) – color name to lookup
Returns:The mapped color
Return type:Gtk.SymbolicColor

Returns the symbolic color that is mapped to name.

New in version 3.0.

Deprecated since version 3.8: Gtk.SymbolicColor is deprecated.

map_color(name, color)[source]
Parameters:

Maps color so it can be referenced by name. See Gtk.StyleProperties.lookup_color()

New in version 3.0.

Deprecated since version 3.8: Gtk.SymbolicColor is deprecated.

merge(props_to_merge, replace)[source]
Parameters:

Merges into self all the style information contained in props_to_merge. If replace is True, the values will be overwritten, if it is False, the older values will prevail.

New in version 3.0.

Deprecated since version 3.16: Gtk.StyleProperties are deprecated.

set_property(property, state, value)[source]
Parameters:
  • property (str) – styling property to set
  • state (Gtk.StateFlags) – state to set the value for
  • value (GObject.Value) – new value for the property

Sets a styling property in self.

New in version 3.0.

Deprecated since version 3.16: Gtk.StyleProperties are deprecated.

unset_property(property, state)[source]
Parameters:

Unsets a style property in self.

New in version 3.0.

Deprecated since version 3.16: Gtk.StyleProperties are deprecated.