Gtk.Style¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the style has been initialized for a particular visual. |
|
Emitted when the aspects of the style specific to a particular visual is being cleaned up. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
attach_count |
r |
||
background |
r |
Set of background |
|
base |
r |
Set of base |
|
bg |
r |
Set of background |
|
black |
r |
|
|
dark |
r |
Set of dark |
|
fg |
r |
Set of foreground |
|
font_desc |
r |
||
icon_factories |
[ |
r |
|
light |
r |
Set of light |
|
mid |
r |
Set of mid |
|
parent_instance |
r |
||
private_font_desc |
r |
||
property_cache |
[ |
r |
|
rc_style |
r |
||
styles |
[ |
r |
|
text |
r |
Set of text |
|
text_aa |
r |
Color halfway between text/base |
|
visual |
r |
||
white |
r |
|
|
xthickness |
r |
Thickness in X direction |
|
ythickness |
r |
Thickness in Y direction |
Class Details¶
- class Gtk.Style(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
Gtk.Style
object encapsulates the information that provides the look and feel for a widget.In GTK+ 3.0,
Gtk.Style
has been deprecated and replaced byGtk.StyleContext
.Each
Gtk.Widget
has an associatedGtk.Style
object that is used when rendering that widget. Also, aGtk.Style
holds information for the five possible widget states though not every widget supports all five states; seeGtk.StateType
.Usually the
Gtk.Style
for a widget is the same as the default style that is set by GTK+ and modified the theme engine.Usually applications should not need to use or modify the
Gtk.Style
of their widgets.- classmethod new()[source]¶
-
Creates a new
Gtk.Style
.Deprecated since version 3.0: Use
Gtk.StyleContext
- apply_default_background(cr, window, state_type, x, y, width, height)[source]¶
- Parameters:
cr (
cairo.Context
) –window (
Gdk.Window
) –state_type (
Gtk.StateType
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
Deprecated since version 3.0: Use
Gtk.StyleContext
instead
- copy()[source]¶
- Returns:
a copy of self
- Return type:
Creates a copy of the passed in
Gtk.Style
object.Deprecated since version 3.0: Use
Gtk.StyleContext
instead
- detach()[source]¶
Detaches a style from a window. If the style is not attached to any windows anymore, it is unrealized. See gtk_style_attach().
Deprecated since version 3.0: Use
Gtk.StyleContext
instead
- get_style_property(widget_type, property_name)[source]¶
- Parameters:
widget_type (
GObject.GType
) – theGObject.GType
of a descendant ofGtk.Widget
property_name (
str
) – the name of the style property to get
- Returns:
a
GObject.Value
where the value of the property being queried will be stored- Return type:
value:
GObject.Value
Queries the value of a style property corresponding to a widget class is in the given style.
New in version 2.16.
- has_context()[source]¶
- Returns:
True
if self has aGtk.StyleContext
- Return type:
Returns whether self has an associated
Gtk.StyleContext
.New in version 3.0.
- lookup_color(color_name)[source]¶
- Parameters:
color_name (
str
) – the name of the logical color to look up- Returns:
True
if the mapping was found.- color:
the
Gdk.Color
to fill in
- Return type:
Looks up color_name in the style’s logical color mappings, filling in color and returning
True
if found, otherwise returningFalse
. Do not cache the found mapping, because it depends on theGtk.Style
and might change when a theme switch occurs.New in version 2.10.
Deprecated since version 3.0: Use
Gtk.StyleContext.lookup_color
() instead
- lookup_icon_set(stock_id)[source]¶
- Parameters:
stock_id (
str
) – an icon name- Returns:
icon set of stock_id
- Return type:
Looks up stock_id in the icon factories associated with self and the default icon factory, returning an icon set if found, otherwise
None
.Deprecated since version 3.0: Use
Gtk.StyleContext.lookup_icon_set
() instead
- render_icon(source, direction, state, size, widget, detail)[source]¶
- Parameters:
source (
Gtk.IconSource
) – theGtk.IconSource
specifying the icon to renderdirection (
Gtk.TextDirection
) – a text directionstate (
Gtk.StateType
) – a statesize (
int
) – the size to render the icon at (Gtk.IconSize
). A size of(GtkIconSize)-1
means render at the size of the source and don’t scale.widget (
Gtk.Widget
orNone
) – the widget
- Returns:
a newly-created
GdkPixbuf.Pixbuf
containing the rendered icon- Return type:
Renders the icon specified by source at the given size according to the given parameters and returns the result in a pixbuf.
Deprecated since version 3.0: Use
Gtk.render_icon_pixbuf
() instead
- set_background(window, state_type)[source]¶
- Parameters:
window (
Gdk.Window
) – aGdk.Window
state_type (
Gtk.StateType
) – a state
Sets the background of window to the background color or pixmap specified by self for the given state.
Deprecated since version 3.0: Use
Gtk.StyleContext.set_background
() instead
- do_draw_arrow(cr, state_type, shadow_type, widget, detail, arrow_type, fill, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –arrow_type (
Gtk.ArrowType
) –fill (
bool
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_box(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_box_gap(cr, state_type, shadow_type, widget, detail, x, y, width, height, gap_side, gap_x, gap_width) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –gap_side (
Gtk.PositionType
) –gap_x (
int
) –gap_width (
int
) –
- do_draw_check(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_diamond(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_expander(cr, state_type, widget, detail, x, y, expander_style) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –expander_style (
Gtk.ExpanderStyle
) –
- do_draw_extension(cr, state_type, shadow_type, widget, detail, x, y, width, height, gap_side) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –gap_side (
Gtk.PositionType
) –
- do_draw_flat_box(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_focus(cr, state_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_handle(cr, state_type, shadow_type, widget, detail, x, y, width, height, orientation) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –orientation (
Gtk.Orientation
) –
- do_draw_hline(cr, state_type, widget, detail, x1, x2, y) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –widget (
Gtk.Widget
) –detail (
str
) –x1 (
int
) –x2 (
int
) –y (
int
) –
- do_draw_layout(cr, state_type, use_text, widget, detail, x, y, layout) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –use_text (
bool
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –layout (
Pango.Layout
) –
- do_draw_option(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_resize_grip(cr, state_type, widget, detail, edge, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –widget (
Gtk.Widget
) –detail (
str
) –edge (
Gdk.WindowEdge
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_shadow(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_shadow_gap(cr, state_type, shadow_type, widget, detail, x, y, width, height, gap_side, gap_x, gap_width) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –gap_side (
Gtk.PositionType
) –gap_x (
int
) –gap_width (
int
) –
- do_draw_slider(cr, state_type, shadow_type, widget, detail, x, y, width, height, orientation) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –orientation (
Gtk.Orientation
) –
- do_draw_spinner(cr, state_type, widget, detail, step, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –widget (
Gtk.Widget
) –detail (
str
) –step (
int
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_tab(cr, state_type, shadow_type, widget, detail, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –shadow_type (
Gtk.ShadowType
) –widget (
Gtk.Widget
) –detail (
str
) –x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- do_draw_vline(cr, state_type, widget, detail, y1_, y2_, x) virtual¶
- Parameters:
cr (
cairo.Context
) –state_type (
Gtk.StateType
) –widget (
Gtk.Widget
) –detail (
str
) –y1 (
int
) –y2 (
int
) –x (
int
) –
- do_init_from_rc(rc_style) virtual¶
- Parameters:
rc_style (
Gtk.RcStyle
) –
- do_realize() virtual¶
- do_render_icon(source, direction, state, size, widget, detail) virtual¶
- Parameters:
source (
Gtk.IconSource
) – theGtk.IconSource
specifying the icon to renderdirection (
Gtk.TextDirection
) – a text directionstate (
Gtk.StateType
) – a statesize (
int
) – the size to render the icon at (Gtk.IconSize
). A size of(GtkIconSize)-1
means render at the size of the source and don’t scale.widget (
Gtk.Widget
orNone
) – the widget
- Returns:
a newly-created
GdkPixbuf.Pixbuf
containing the rendered icon- Return type:
Renders the icon specified by source at the given size according to the given parameters and returns the result in a pixbuf.
Deprecated since version 3.0: Use
Gtk.render_icon_pixbuf
() instead
- do_set_background(window, state_type) virtual¶
- Parameters:
window (
Gdk.Window
) – aGdk.Window
state_type (
Gtk.StateType
) – a state
Sets the background of window to the background color or pixmap specified by style for the given state.
Deprecated since version 3.0: Use
Gtk.StyleContext.set_background
() instead
- do_unrealize() virtual¶
Signal Details¶
- Gtk.Style.signals.realize(style)¶
- Signal Name:
realize
- Flags:
- Parameters:
style (
Gtk.Style
) – The object which received the signal
Emitted when the style has been initialized for a particular visual. Connecting to this signal is probably seldom useful since most of the time applications and widgets only deal with styles that have been already realized.
New in version 2.4.
- Gtk.Style.signals.unrealize(style)¶
- Signal Name:
unrealize
- Flags:
- Parameters:
style (
Gtk.Style
) – The object which received the signal
Emitted when the aspects of the style specific to a particular visual is being cleaned up. A connection to this signal can be useful if a widget wants to cache objects as object data on
Gtk.Style
. This signal provides a convenient place to free such cached objects.New in version 2.4.
Property Details¶
- Gtk.Style.props.context¶
- Name:
context
- Type:
- Default Value:
- Flags:
Gtk.StyleContext
to get style from