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.
Instance methods
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_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_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
Properties
Gtk.Style:context
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)
GObject.Object::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
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 |
|
The parent class. |
|
realize |
|
No description available. | |
unrealize |
|
No description available. | |
copy |
|
No description available. | |
clone |
|
No description available. | |
init_from_rc |
|
No description available. | |
set_background |
|
No description available. | |
render_icon |
|
No description available. | |
draw_hline |
|
No description available. | |
draw_vline |
|
No description available. | |
draw_shadow |
|
No description available. | |
draw_arrow |
|
No description available. | |
draw_diamond |
|
No description available. | |
draw_box |
|
No description available. | |
draw_flat_box |
|
No description available. | |
draw_check |
|
No description available. | |
draw_option |
|
No description available. | |
draw_tab |
|
No description available. | |
draw_shadow_gap |
|
No description available. | |
draw_box_gap |
|
No description available. | |
draw_extension |
|
No description available. | |
draw_focus |
|
No description available. | |
draw_slider |
|
No description available. | |
draw_handle |
|
No description available. | |
draw_expander |
|
No description available. | |
draw_layout |
|
No description available. | |
draw_resize_grip |
|
No description available. | |
draw_spinner |
|
No description available. | |
_gtk_reserved1 |
|
No description available. | |
_gtk_reserved2 |
|
No description available. | |
_gtk_reserved3 |
|
No description available. | |
_gtk_reserved4 |
|
No description available. | |
_gtk_reserved5 |
|
No description available. | |
_gtk_reserved6 |
|
No description available. | |
_gtk_reserved7 |
|
No description available. | |
_gtk_reserved8 |
|
No description available. | |
_gtk_reserved9 |
|
No description available. | |
_gtk_reserved10 |
|
No description available. | |
_gtk_reserved11 |
|
No description available. |
Virtual methods
Gtk.StyleClass.clone
Gtk.StyleClass.copy
Gtk.StyleClass.draw_arrow
Gtk.StyleClass.draw_box
Gtk.StyleClass.draw_box_gap
Gtk.StyleClass.draw_check
Gtk.StyleClass.draw_diamond
Gtk.StyleClass.draw_expander
Gtk.StyleClass.draw_extension
Gtk.StyleClass.draw_flat_box
Gtk.StyleClass.draw_focus
Gtk.StyleClass.draw_handle
Gtk.StyleClass.draw_hline
Gtk.StyleClass.draw_layout
Gtk.StyleClass.draw_option
Gtk.StyleClass.draw_resize_grip
Gtk.StyleClass.draw_shadow
Gtk.StyleClass.draw_shadow_gap
Gtk.StyleClass.draw_slider
Gtk.StyleClass.draw_spinner
Gtk.StyleClass.draw_tab
Gtk.StyleClass.draw_vline
Gtk.StyleClass.init_from_rc
Gtk.StyleClass.realize
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