GObject.Object
Gtk.StyleContext
Import line: | Gtk = imports.gi.Gtk; |
GIR File: | Gtk-3.0.gir |
C documentation: | GtkStyleContext |
Class : | StyleContext |
Extends: | GObject.Object |
Properties | Defined By | |
---|---|---|
direction : Gtk.TextDirection
|
Gtk.StyleContext | |
parent_object : GObject.Object
read only
|
Gtk.StyleContext | |
priv : Gtk.StyleContextPrivate
read only
|
Gtk.StyleContext | |
screen : Gdk.Screen
|
Gtk.StyleContext |
Method / Constructor | Defined By | |
---|---|---|
new Gtk.StyleContext
(Object properties)
Create a new Gtk.StyleContext
Create a new Gtk.StyleContext
|
||
Gtk.StyleContext.add_provider_for_screen
(Screen screen, StyleProvider provider, guint32 priority)
:
none
Adds a global style provider to screen, which will be used
in style construction for all GtkStyleContexts under GTK+ uses this to make styling information from GtkSettings available.
Adds a global style provider to screen, which will be used
in style construction for all GtkStyleContexts under GTK+ uses this to make styling information from GtkSettings available. added through gtk_style_context_add_provider() takes precedence over another added through this function.
|
Gtk.StyleContext | |
Removes provider from the global style providers list in screen.
Removes provider from the global style providers list in screen.
|
Gtk.StyleContext | |
Gtk.StyleContext.reset_widgets
(Screen screen)
:
none
This function recomputes the styles for all widgets under a particular
GdkScreen.
This function recomputes the styles for all widgets under a particular
GdkScreen. This is useful when some global parameter has changed that affects the appearance of all widgets, because when a widget gets a new style, it will both redraw and recompute any cached information about its appearance. As an example, it is used when the color scheme changes in the related GtkSettings object.
|
Gtk.StyleContext | |
add_class
(String class_name)
:
none
Adds a style class to context, so posterior calls to
gtk_style_context_get() or any of the gtk_render_*() functions will make use of this new class for styling.
Adds a style class to context, so posterior calls to
gtk_style_context_get() or any of the gtk_render_*() functions will make use of this new class for styling. In the CSS file format, a GtkEntry defining an "entry" class, would be matched by: GtkEntry.entry { ... } While any widget defining an "entry" class would be matched by: .entry { ... }
|
Gtk.StyleContext | |
add_provider
(StyleProvider provider, guint32 priority)
:
none
Adds a style provider to context, to be used in style construction.
Adds a style provider to context, to be used in style construction.
added through this function takes precedence over another added through gtk_style_context_add_provider_for_screen().
|
Gtk.StyleContext | |
add_region
(String region_name, RegionFlags flags)
:
none
Adds a region to context, so posterior calls to
gtk_style_context_get() or any of the gtk_render_*() functions will make use of this new region for styling.
Adds a region to context, so posterior calls to
gtk_style_context_get() or any of the gtk_render_*() functions will make use of this new region for styling. In the CSS file format, a GtkTreeView defining a "row" region, would be matched by: GtkTreeView row { ... } Pseudo-classes are used for matching flags, so the two following rules: GtkTreeView row:nth-child (even) { ... } GtkTreeView row:nth-child (odd) { ... } would apply to even and odd rows, respectively. and '-', starting always with a lowercase letter.
|
Gtk.StyleContext | |
cancel_animations
(void* region_id)
:
none
Stops all running animations for region_id and all animatable
regions underneath.
Stops all running animations for region_id and all animatable
regions underneath. A NULL region_id will stop all ongoing animations in context, when dealing with a GtkStyleContext obtained through gtk_widget_get_style_context(), this is normally done for you in all circumstances you would expect all widget to be stopped, so this should be only used in complex widgets with different animatable regions.
|
Gtk.StyleContext | |
get_background_color
(StateFlags state)
:
Gdk.RGBA
Gets the background color for a given state.
Gets the background color for a given state.
|
Gtk.StyleContext | |
get_border
(StateFlags state)
:
Gtk.Border
Gets the border for a given state as a GtkBorder.
Gets the border for a given state as a GtkBorder.
See GTK_STYLE_PROPERTY_BORDER_WIDTH.
|
Gtk.StyleContext | |
get_border_color
(StateFlags state)
:
Gdk.RGBA
Gets the border color for a given state.
Gets the border color for a given state.
|
Gtk.StyleContext | |
get_color
(StateFlags state)
:
Gdk.RGBA
Gets the foreground color for a given state.
Gets the foreground color for a given state.
|
Gtk.StyleContext | |
get_direction
()
:
Gtk.TextDirection
Returns the widget direction used for rendering.
Returns the widget direction used for rendering.
|
Gtk.StyleContext | |
get_font
(StateFlags state)
:
Pango.FontDescription
Returns the font description for a given state.
Returns the font description for a given state. The returned
object is const and will remain valid until the GtkStyleContext::changed signal happens. state. This object is owned by GTK+ and should not be freed.
|
Gtk.StyleContext | |
get_junction_sides
()
:
Gtk.JunctionSides
Returns the sides where rendered elements connect visually with others.
Returns the sides where rendered elements connect visually with others.
|
Gtk.StyleContext | |
get_margin
(StateFlags state)
:
Gtk.Border
Gets the margin for a given state as a GtkBorder.
Gets the margin for a given state as a GtkBorder.
See GTK_STYLE_PROPERTY_MARGIN.
|
Gtk.StyleContext | |
get_padding
(StateFlags state)
:
Gtk.Border
Gets the padding for a given state as a GtkBorder.
Gets the padding for a given state as a GtkBorder.
See GTK_STYLE_PROPERTY_PADDING.
|
Gtk.StyleContext | |
get_path
()
:
Gtk.WidgetPath
Returns the widget path used for style matching.
Returns the widget path used for style matching.
|
Gtk.StyleContext | |
Gets a style property from context for the given state.
Gets a style property from context for the given state.
When value is no longer needed, g_value_unset() must be called to free any allocated memory.
|
Gtk.StyleContext | |
get_screen
()
:
Gdk.Screen
Returns the GdkScreen to which context is attached.
Returns the GdkScreen to which context is attached.
|
Gtk.StyleContext | |
get_state
()
:
Gtk.StateFlags
Returns the state used when rendering.
Returns the state used when rendering.
|
Gtk.StyleContext | |
Gets the value for a widget style property.
Gets the value for a widget style property.
When value is no longer needed, g_value_unset() must be called to free any allocated memory.
|
Gtk.StyleContext | |
Gtk.StyleContext | ||
Returns TRUE if context has the region defined.
Returns TRUE if context has the region defined.
If flags_return is not NULL, it is set to the flags affecting the region.
|
Gtk.StyleContext | |
invalidate
()
:
none
Invalidates context style information, so it will be reconstructed
again.
Invalidates context style information, so it will be reconstructed
again. If you're using a GtkStyleContext returned from gtk_widget_get_style_context(), you do not need to call this yourself.
|
Gtk.StyleContext | |
list_classes
()
:
Array
Returns the list of classes currently defined in context.
Returns the list of classes currently defined in context.
strings with the currently defined classes. The contents of the list are owned by GTK+, but you must free the list itself with g_list_free() when you are done with it.
|
Gtk.StyleContext | |
list_regions
()
:
Array
Returns the list of regions currently defined in context.
Returns the list of regions currently defined in context.
strings with the currently defined regions. The contents of the list are owned by GTK+, but you must free the list itself with g_list_free() when you are done with it.
|
Gtk.StyleContext | |
Looks up and resolves a color name in the context color map.
|
Gtk.StyleContext | |
lookup_icon_set
(String stock_id)
:
Gtk.IconSet
Looks up stock_id in the icon factories associated to context and
the default icon factory, returning an icon set if found, otherwise NULL.
Looks up stock_id in the icon factories associated to context and
the default icon factory, returning an icon set if found, otherwise NULL.
|
Gtk.StyleContext | |
Notifies a state change on context, so if the current style makes use
of transition animations, one will be started so all rendered elements under region_id are animated for state state being set to value The window parameter is used in order to invalidate the rendered area as the animation runs, so make sure it is the same window that is being rendered on by the gtk_render_*() functions.
Notifies a state change on context, so if the current style makes use
of transition animations, one will be started so all rendered elements under region_id are animated for state state being set to value The window parameter is used in order to invalidate the rendered area as the animation runs, so make sure it is the same window that is being rendered on by the gtk_render_*() functions. If region_id is NULL, all rendered elements using context will be affected by this state transition. As a practical example, a GtkButton notifying a state transition on the prelight state: gtk_style_context_notify_state_change (context, gtk_widget_get_window (widget), NULL, GTK_STATE_PRELIGHT, button->in_button); Can be handled in the CSS file like this: GtkButton { } GtkButton:hover { } This combination will animate the button background from red to white if a pointer enters the button, and back to red if the pointer leaves the button. Note that state is used when finding the transition parameters, which is why the style places the transition under the :hover pseudo-class.
|
Gtk.StyleContext | |
pop_animatable_region
()
:
none
Pops an animatable region from context.
Pops an animatable region from context.
See gtk_style_context_push_animatable_region().
|
Gtk.StyleContext | |
push_animatable_region
(void* region_id)
:
none
Pushes an animatable region, so all further gtk_render_*() calls between
this call and the following gtk_style_context_pop_animatable_region() will potentially show transition animations for this region if gtk_style_context_notify_state_change() is called for a given state, and the current theme/style defines transition animations for state changes.
Pushes an animatable region, so all further gtk_render_*() calls between
this call and the following gtk_style_context_pop_animatable_region() will potentially show transition animations for this region if gtk_style_context_notify_state_change() is called for a given state, and the current theme/style defines transition animations for state changes. The region_id used must be unique in context so the theming engine can uniquely identify rendered elements subject to a state transition.
|
Gtk.StyleContext | |
remove_class
(String class_name)
:
none
Removes class_name from context.
Removes class_name from context.
|
Gtk.StyleContext | |
remove_provider
(StyleProvider provider)
:
none
Removes provider from the style providers list in context.
Removes provider from the style providers list in context.
|
Gtk.StyleContext | |
remove_region
(String region_name)
:
none
Removes a region from context.
Removes a region from context.
|
Gtk.StyleContext | |
restore
()
:
none
Restores context state to a previous stage.
Restores context state to a previous stage.
See gtk_style_context_save().
|
Gtk.StyleContext | |
save
()
:
none
Saves the context state, so all modifications done through
gtk_style_context_add_class(), gtk_style_context_remove_class(), gtk_style_context_add_region(), gtk_style_context_remove_region() or gtk_style_context_set_junction_sides() can be reverted in one go through gtk_style_context_restore().
Saves the context state, so all modifications done through
gtk_style_context_add_class(), gtk_style_context_remove_class(), gtk_style_context_add_region(), gtk_style_context_remove_region() or gtk_style_context_set_junction_sides() can be reverted in one go through gtk_style_context_restore().
|
Gtk.StyleContext | |
This function is analogous to gdk_window_scroll(), and
should be called together with it so the invalidation areas for any ongoing animation are scrolled together with it.
This function is analogous to gdk_window_scroll(), and
should be called together with it so the invalidation areas for any ongoing animation are scrolled together with it.
|
Gtk.StyleContext | |
set_background
(Window window)
:
none
Sets the background of window to the background pattern or
color specified in context for its current state.
Sets the background of window to the background pattern or
color specified in context for its current state.
|
Gtk.StyleContext | |
set_direction
(TextDirection direction)
:
none
Sets the reading direction for rendering purposes.
Sets the reading direction for rendering purposes.
If you are using a GtkStyleContext returned from gtk_widget_get_style_context(), you do not need to call this yourself.
|
Gtk.StyleContext | |
set_junction_sides
(JunctionSides sides)
:
none
Sets the sides where rendered elements (mostly through
gtk_render_frame()) will visually connect with other visual elements.
Sets the sides where rendered elements (mostly through
gtk_render_frame()) will visually connect with other visual elements. This is merely a hint that may or may not be honored by theming engines. Container widgets are expected to set junction hints as appropriate for their children, so it should not normally be necessary to call this function manually.
|
Gtk.StyleContext | |
set_path
(WidgetPath path)
:
none
Sets the GtkWidgetPath used for style matching.
Sets the GtkWidgetPath used for style matching. As a
consequence, the style will be regenerated to match the new given path. If you are using a GtkStyleContext returned from gtk_widget_get_style_context(), you do not need to call this yourself.
|
Gtk.StyleContext | |
set_screen
(Screen screen)
:
none
Attaches context to the given screen.
Attaches context to the given screen.
The screen is used to add style information from 'global' style providers, such as the screens GtkSettings instance. If you are using a GtkStyleContext returned from gtk_widget_get_style_context(), you do not need to call this yourself.
|
Gtk.StyleContext | |
set_state
(StateFlags flags)
:
none
Sets the state to be used when rendering with any
of the gtk_render_*() functions.
Sets the state to be used when rendering with any
of the gtk_render_*() functions.
|
Gtk.StyleContext | |
Returns TRUE if there is a transition animation running for the
current region (see gtk_style_context_push_animatable_region()).
Returns TRUE if there is a transition animation running for the
current region (see gtk_style_context_push_animatable_region()). If progress is not NULL, the animation progress will be returned there, 0.0 means the state is closest to being unset, while 1.0 means it's closest to being set. This means transition animation will run from 0 to 1 when state is being set and from 1 to 0 when it's being unset.
|
Gtk.StyleContext |
Event | Defined By | |
---|---|---|
changed (StyleContext self)
:
none
|
Gtk.StyleContext |
Class / Namespace | Method / Signal / Properties |
---|---|
Gtk
Method |
Gtk.render_activity
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders an activity area (Such as in GtkSpinner or the
fill line in GtkRange), the state GTK_STATE_FLAG_ACTIVE determines whether there is activity going on. |
Gtk
Method |
Gtk.render_arrow
(StyleContext context, Context cr, gdouble angle, gdouble x, gdouble y, gdouble size)
:
none
Renders an arrow pointing to angle.
|
Gtk
Method |
Gtk.render_background
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders the background of an element.
|
Gtk
Method |
Gtk.render_check
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders a checkmark (as in a GtkCheckButton).
|
Gtk
Method |
Gtk.render_expander
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders an expander (as used in GtkTreeView and GtkExpander) in the area
defined by x, y, width, height. |
Gtk
Method |
Gtk.render_extension
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height, PositionType gap_side)
:
none
Renders a extension (as in a GtkNotebook tab) in the rectangle
defined by x, y, width, height. |
Gtk
Method |
Gtk.render_focus
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders a focus indicator on the rectangle determined by x, y, width, height.
|
Gtk
Method |
Gtk.render_frame
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders a frame around the rectangle defined by x, y, width, height.
|
Gtk
Method |
Gtk.render_frame_gap
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height, PositionType gap_side, gdouble xy0_gap, gdouble xy1_gap)
:
none
Renders a frame around the rectangle defined by (x, y, width, height),
leaving a gap on one side. |
Gtk
Method |
Gtk.render_handle
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders a handle (as in GtkHandleBox, GtkPaned and
GtkWindow's resize grip), in the rectangle determined by x, y, width, height. |
Gtk
Method |
Renders the icon specified by source at the given size, returning the result
in a pixbuf. |
Gtk
Method |
Renders layout on the coordinates x, y
|
Gtk
Method |
Gtk.render_line
(StyleContext context, Context cr, gdouble x0, gdouble y0, gdouble x1, gdouble y1)
:
none
Renders a line from (x0, y0) to (x1, y1).
|
Gtk
Method |
Gtk.render_option
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height)
:
none
Renders an option mark (as in a GtkRadioButton), the GTK_STATE_FLAG_ACTIVE
state will determine whether the option is on or off, and GTK_STATE_FLAG_INCONSISTENT whether it should be marked as undefined. |
Gtk
Method |
Gtk.render_slider
(StyleContext context, Context cr, gdouble x, gdouble y, gdouble width, gdouble height, Orientation orientation)
:
none
Renders a slider (as in GtkScale) in the rectangle defined by x, y,
or horizontal. |
Gtk.IconInfo
Method |
Loads an icon, modifying it to match the system colors for the foreground,
success, warning and error colors provided. |
Gtk.IconSet
Method |
Renders an icon using gtk_render_icon_pixbuf().
|
Gtk.NumerableIcon
Property |
style_context : Gtk.StyleContext
|
Gtk.NumerableIcon
Method |
Creates a new GtkNumerableIcon which will themed according
to the passed GtkStyleContext. |
Gtk.NumerableIcon
Method |
get_style_context
()
:
Gtk.StyleContext
Returns the GtkStyleContext used by the icon for theming,
or NULL if there's none. |
Gtk.NumerableIcon
Method |
set_style_context
(StyleContext style)
:
none
Updates the icon to fetch theme information from the
given GtkStyleContext. |
Gtk.Style
Property |
context : Gtk.StyleContext
|
Gtk.Widget
Method |
get_style_context
()
:
Gtk.StyleContext
Returns the style context associated to widget.
|