gtkmm 3.24.7
|
Represents a widget style property. More...
#include <gtkmm/styleproperty.h>
Public Types | |
typedef T | PropertyType |
typedef Glib::Value< T > | ValueType |
Public Member Functions | |
StyleProperty (Gtk::Widget & widget, const Glib::ustring & name) | |
Constructs a style property for widget with name. More... | |
StyleProperty (Gtk::Widget & widget, const Glib::ustring & name, const PropertyType & default_value) | |
Constructs a style property for widget with name and default_value. More... | |
PropertyType | get_value () const |
Returns the value of the style property. More... | |
operator PropertyType () const | |
Returns the value of the style property. More... | |
Public Member Functions inherited from Gtk::StylePropertyBase | |
Glib::ustring | get_name () const |
Returns the name of the style property. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Gtk::StylePropertyBase | |
StylePropertyBase (Gtk::Widget & widget, GType value_type) | |
Constructs a style property of type value_type for widget. More... | |
~StylePropertyBase () noexcept | |
bool | lookup_style_property (const Glib::ustring & name) |
Checks if the style property has already been installed. More... | |
void | install_style_property (GParamSpec * param_spec) |
Installs the style property specified by the given param_spec. More... | |
const char * | get_name_internal () const |
Returns the name of the style property. More... | |
Protected Attributes inherited from Gtk::StylePropertyBase | |
Gtk::Widget * | widget_ |
GType | value_type_ |
GParamSpec * | param_spec_ |
Represents a widget style property.
This class maps one to one to a style property of a widget in Gtk. A style property is similar to object properties (Glib::Property), but its value is stored in the style object associated with the widget. The style property, similarly to the object properties, has some global data for each property. The global data includes the following information about the style property:
The StyleProperty class currently supports only the name and default value. The minimum and maximum bounds are set to the full range of the value. The nickname and the description are set to empty. The flags are set to indicate that the property is read-only (this doesn't disallow a style provider to set the value of the property).
The global information must be installed into the widget once per property. This is handled automatically. A reference to the widget must be passed on the construction of the style property.
typedef T Gtk::StyleProperty< T >::PropertyType |
typedef Glib::Value<T> Gtk::StyleProperty< T >::ValueType |
Gtk::StyleProperty< T >::StyleProperty | ( | Gtk::Widget & | widget, |
const Glib::ustring & | name | ||
) |
Constructs a style property for widget with name.
For each instance of the widget, the same property must be constructed with the same name.
Gtk::StyleProperty< T >::StyleProperty | ( | Gtk::Widget & | widget, |
const Glib::ustring & | name, | ||
const PropertyType & | default_value | ||
) |
Constructs a style property for widget with name and default_value.
For each instance of the widget, the same property must be constructed with the same name and default value.
|
inline |
Returns the value of the style property.
Equivalent to Gtk::Widget::get_style_property(get_name(), PropertyType& value).
|
inline |
Returns the value of the style property.
Equivalent to Gtk::Widget::get_style_property(get_name(), PropertyType& value).