Class

GtkStyle

Description [src]

class Gtk.Style : GObject.Object {
  fg: None,
  bg: None,
  light: None,
  dark: None,
  mid: None,
  text: None,
  base: None,
  text_aa: None,
  black: GdkColor,
  white: GdkColor,
  font_desc: PangoFontDescription*,
  xthickness: gint,
  ythickness: gint,
  background: None
}

A GtkStyle object encapsulates the information that provides the look and feel for a widget.

In GTK+ 3.0, GtkStyle has been deprecated and replaced by GtkStyleContext.

Each GtkWidget has an associated GtkStyle object that is used when rendering that widget. Also, a GtkStyle holds information for the five possible widget states though not every widget supports all five states; see GtkStateType.

Usually the GtkStyle 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 GtkStyle of their widgets.

Hierarchy

hierarchy this GtkStyle ancestor_0 GObject ancestor_0--this

Ancestors

Constructors

gtk_style_new

Creates a new GtkStyle.

Deprecated since: 3.0

Instance methods

gtk_style_apply_default_background
No description available.

Deprecated since: 3.0

gtk_style_attach

Attaches a style to a window; this process allocates the colors and creates the GC’s for the style - it specializes it to a particular visual. The process may involve the creation of a new style if the style has already been attached to a window with a different style and visual.

Deprecated since: 3.0

gtk_style_copy

Creates a copy of the passed in GtkStyle object.

Deprecated since: 3.0

gtk_style_detach

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: 3.0

gtk_style_get

Gets the values of a multiple style properties for widget_type from style.

Available since: 2.16

gtk_style_get_style_property

Queries the value of a style property corresponding to a widget class is in the given style.

Available since: 2.16

gtk_style_get_valist

Non-vararg variant of gtk_style_get(). Used primarily by language bindings.

Available since: 2.16

gtk_style_has_context

Returns whether style has an associated GtkStyleContext.

Available since: 3.0

gtk_style_lookup_color

Looks up color_name in the style’s logical color mappings, filling in color and returning TRUE if found, otherwise returning FALSE. Do not cache the found mapping, because it depends on the GtkStyle and might change when a theme switch occurs.

Available since: 2.10

Deprecated since: 3.0

gtk_style_lookup_icon_set

Looks up stock_id in the icon factories associated with style and the default icon factory, returning an icon set if found, otherwise NULL.

Deprecated since: 3.0

gtk_style_render_icon

Renders the icon specified by source at the given size according to the given parameters and returns the result in a pixbuf.

Deprecated since: 3.0

gtk_style_set_background

Sets the background of window to the background color or pixmap specified by style for the given state.

Deprecated since: 3.0

Methods inherited from GObject (42)

Properties

Gtk.Style:context
No description available.

Signals

Gtk.Style::realize

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.

Available since: 2.4

Gtk.Style::unrealize

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 GtkStyle. This signal provides a convenient place to free such cached objects.

Available since: 2.4

Signals inherited from GObject (1)

Class structure

struct GtkStyleClass {
  GObjectClass parent_class;
  void (* realize) (
    GtkStyle* style
  );
  void (* unrealize) (
    GtkStyle* style
  );
  void (* copy) (
    GtkStyle* style,
    GtkStyle* src
  );
  GtkStyle* (* clone) (
    GtkStyle* style
  );
  void (* init_from_rc) (
    GtkStyle* style,
    GtkRcStyle* rc_style
  );
  void (* set_background) (
    GtkStyle* style,
    GdkWindow* window,
    GtkStateType state_type
  );
  GdkPixbuf* (* render_icon) (
    GtkStyle* style,
    const GtkIconSource* source,
    GtkTextDirection direction,
    GtkStateType state,
    GtkIconSize size,
    GtkWidget* widget,
    const gchar* detail
  );
  void (* draw_hline) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x1,
    gint x2,
    gint y
  );
  void (* draw_vline) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint y1_,
    gint y2_,
    gint x
  );
  void (* draw_shadow) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_arrow) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    GtkArrowType arrow_type,
    gboolean fill,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_diamond) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_box) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_flat_box) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_check) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_option) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_tab) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_shadow_gap) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkPositionType gap_side,
    gint gap_x,
    gint gap_width
  );
  void (* draw_box_gap) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkPositionType gap_side,
    gint gap_x,
    gint gap_width
  );
  void (* draw_extension) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkPositionType gap_side
  );
  void (* draw_focus) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_slider) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkOrientation orientation
  );
  void (* draw_handle) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkOrientation orientation
  );
  void (* draw_expander) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    GtkExpanderStyle expander_style
  );
  void (* draw_layout) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    gboolean use_text,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    PangoLayout* layout
  );
  void (* draw_resize_grip) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    GdkWindowEdge edge,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* draw_spinner) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    guint step,
    gint x,
    gint y,
    gint width,
    gint height
  );
  void (* _gtk_reserved1) (
void
  );
  void (* _gtk_reserved2) (
void
  );
  void (* _gtk_reserved3) (
void
  );
  void (* _gtk_reserved4) (
void
  );
  void (* _gtk_reserved5) (
void
  );
  void (* _gtk_reserved6) (
void
  );
  void (* _gtk_reserved7) (
void
  );
  void (* _gtk_reserved8) (
void
  );
  void (* _gtk_reserved9) (
void
  );
  void (* _gtk_reserved10) (
void
  );
  void (* _gtk_reserved11) (
void
  );
  
}
Class members
parent_class
GObjectClass
 

The parent class.

realize
void (* realize) (
    GtkStyle* style
  )
  No description available.
unrealize
void (* unrealize) (
    GtkStyle* style
  )
  No description available.
copy
void (* copy) (
    GtkStyle* style,
    GtkStyle* src
  )
  No description available.
clone
GtkStyle* (* clone) (
    GtkStyle* style
  )
  No description available.
init_from_rc
void (* init_from_rc) (
    GtkStyle* style,
    GtkRcStyle* rc_style
  )
  No description available.
set_background
void (* set_background) (
    GtkStyle* style,
    GdkWindow* window,
    GtkStateType state_type
  )
  No description available.
render_icon
GdkPixbuf* (* render_icon) (
    GtkStyle* style,
    const GtkIconSource* source,
    GtkTextDirection direction,
    GtkStateType state,
    GtkIconSize size,
    GtkWidget* widget,
    const gchar* detail
  )
  No description available.
draw_hline
void (* draw_hline) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x1,
    gint x2,
    gint y
  )
  No description available.
draw_vline
void (* draw_vline) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint y1_,
    gint y2_,
    gint x
  )
  No description available.
draw_shadow
void (* draw_shadow) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_arrow
void (* draw_arrow) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    GtkArrowType arrow_type,
    gboolean fill,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_diamond
void (* draw_diamond) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_box
void (* draw_box) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_flat_box
void (* draw_flat_box) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_check
void (* draw_check) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_option
void (* draw_option) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_tab
void (* draw_tab) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_shadow_gap
void (* draw_shadow_gap) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkPositionType gap_side,
    gint gap_x,
    gint gap_width
  )
  No description available.
draw_box_gap
void (* draw_box_gap) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkPositionType gap_side,
    gint gap_x,
    gint gap_width
  )
  No description available.
draw_extension
void (* draw_extension) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkPositionType gap_side
  )
  No description available.
draw_focus
void (* draw_focus) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_slider
void (* draw_slider) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkOrientation orientation
  )
  No description available.
draw_handle
void (* draw_handle) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkShadowType shadow_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    gint width,
    gint height,
    GtkOrientation orientation
  )
  No description available.
draw_expander
void (* draw_expander) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    GtkExpanderStyle expander_style
  )
  No description available.
draw_layout
void (* draw_layout) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    gboolean use_text,
    GtkWidget* widget,
    const gchar* detail,
    gint x,
    gint y,
    PangoLayout* layout
  )
  No description available.
draw_resize_grip
void (* draw_resize_grip) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    GdkWindowEdge edge,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
draw_spinner
void (* draw_spinner) (
    GtkStyle* style,
    cairo_t* cr,
    GtkStateType state_type,
    GtkWidget* widget,
    const gchar* detail,
    guint step,
    gint x,
    gint y,
    gint width,
    gint height
  )
  No description available.
_gtk_reserved1
void (* _gtk_reserved1) (
void
  )
  No description available.
_gtk_reserved2
void (* _gtk_reserved2) (
void
  )
  No description available.
_gtk_reserved3
void (* _gtk_reserved3) (
void
  )
  No description available.
_gtk_reserved4
void (* _gtk_reserved4) (
void
  )
  No description available.
_gtk_reserved5
void (* _gtk_reserved5) (
void
  )
  No description available.
_gtk_reserved6
void (* _gtk_reserved6) (
void
  )
  No description available.
_gtk_reserved7
void (* _gtk_reserved7) (
void
  )
  No description available.
_gtk_reserved8
void (* _gtk_reserved8) (
void
  )
  No description available.
_gtk_reserved9
void (* _gtk_reserved9) (
void
  )
  No description available.
_gtk_reserved10
void (* _gtk_reserved10) (
void
  )
  No description available.
_gtk_reserved11
void (* _gtk_reserved11) (
void
  )
  No description available.

Virtual methods

Gtk.StyleClass.clone
No description available.
Gtk.StyleClass.copy
No description available.
Gtk.StyleClass.draw_arrow
No description available.
Gtk.StyleClass.draw_box
No description available.
Gtk.StyleClass.draw_box_gap
No description available.
Gtk.StyleClass.draw_check
No description available.
Gtk.StyleClass.draw_diamond
No description available.
Gtk.StyleClass.draw_expander
No description available.
Gtk.StyleClass.draw_extension
No description available.
Gtk.StyleClass.draw_flat_box
No description available.
Gtk.StyleClass.draw_focus
No description available.
Gtk.StyleClass.draw_handle
No description available.
Gtk.StyleClass.draw_hline
No description available.
Gtk.StyleClass.draw_layout
No description available.
Gtk.StyleClass.draw_option
No description available.
Gtk.StyleClass.draw_resize_grip
No description available.
Gtk.StyleClass.draw_shadow
No description available.
Gtk.StyleClass.draw_shadow_gap
No description available.
Gtk.StyleClass.draw_slider
No description available.
Gtk.StyleClass.draw_spinner
No description available.
Gtk.StyleClass.draw_tab
No description available.
Gtk.StyleClass.draw_vline
No description available.
Gtk.StyleClass.init_from_rc
No description available.
Gtk.StyleClass.realize
No description available.
Gtk.StyleClass.render_icon

Renders the icon specified by source at the given size according to the given parameters and returns the result in a pixbuf.

Deprecated since: 3.0

Gtk.StyleClass.set_background

Sets the background of window to the background color or pixmap specified by style for the given state.

Deprecated since: 3.0

Gtk.StyleClass.unrealize
No description available.