Style
Object Hierarchy:
Description:
[ CCode ( type_id = "gtk_style_get_type ()" ) ]
[ Version ( deprecated = true , deprecated_since = "3.0" , replacement = "StyleContext" ) ]
public class Style : Object
[ Version ( deprecated = true , deprecated_since = "3.0" , replacement = "StyleContext" ) ]
public class Style : Object
Warning: Style is deprecated since 3.0. Use StyleContext.
A Style object encapsulates the information that provides the look and feel for a widget.
Note:
In GTK+ 3.0, GtkStyle has been deprecated and replaced by StyleContext.
Each Widget has an associated Style object that is used when rendering that widget. Also, a Style holds information for the five possible widget states though not every widget supports all five states; see StateType.
Usually the 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 Style of their widgets.
Namespace: Gtk
Package: gtk+-3.0
Content:
Properties:
- public StyleContext context { owned get; construct; }
Creation methods:
- public Style ()
Creates a new Style.
Methods:
- public void @get (Type widget_type, ...)
Gets the values of a multiple style properties for
widget_type
from this. - public void apply_default_background (Context cr, Window window, StateType state_type, int x, int y, int width, int height)
- public virtual Style clone ()
- public Style copy ()
Creates a copy of the passed in Style object.
- public virtual void copy_to (Style dest)
- public void detach ()
Detaches a style from a window.
- public virtual void draw_arrow (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, ArrowType arrow_type, bool fill, int x, int y, int width, int height)
- public virtual void draw_box (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_box_gap (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height, PositionType gap_side, int gap_x, int gap_width)
- public virtual void draw_check (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_diamond (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_expander (Context cr, StateType state_type, Widget widget, string detail, int x, int y, ExpanderStyle expander_style)
- public virtual void draw_extension (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height, PositionType gap_side)
- public virtual void draw_flat_box (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_focus (Context cr, StateType state_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_handle (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height, Orientation orientation)
- public virtual void draw_hline (Context cr, StateType state_type, Widget widget, string detail, int x1, int x2, int y)
- public virtual void draw_layout (Context cr, StateType state_type, bool use_text, Widget widget, string detail, int x, int y, Layout layout)
- public virtual void draw_option (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_resize_grip (Context cr, StateType state_type, Widget widget, string detail, WindowEdge edge, int x, int y, int width, int height)
- public virtual void draw_shadow (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_shadow_gap (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height, PositionType gap_side, int gap_x, int gap_width)
- public virtual void draw_slider (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height, Orientation orientation)
- public virtual void draw_spinner (Context cr, StateType state_type, Widget widget, string detail, uint step, int x, int y, int width, int height)
- public virtual void draw_tab (Context cr, StateType state_type, ShadowType shadow_type, Widget widget, string detail, int x, int y, int width, int height)
- public virtual void draw_vline (Context cr, StateType state_type, Widget widget, string detail, int y1_, int y2_, int x)
- public void get_style_property (Type widget_type, string property_name, ref Value value)
Queries the value of a style property corresponding to a widget class is in the given style.
- public void get_valist (Type widget_type, string first_property_name, va_list var_args)
Non-vararg variant of @get.
- public bool has_context ()
Returns whether this has an associated StyleContext.
- public virtual void init_from_rc (RcStyle rc_style)
- public bool lookup_color (string color_name, out Color color)
Looks up
color_name
in the style’s logical color mappings, filling incolor
and returning true if found, otherwise returning false. - public unowned IconSet lookup_icon_set (string stock_id)
Looks up
stock_id
in the icon factories associated with this and the default icon factory, returning an icon set if found, otherwise null. - public virtual Pixbuf render_icon (IconSource source, TextDirection direction, StateType state, int size, Widget? widget, string? detail)
Renders the icon specified by
source
at the givensize
according to the given parameters and returns the result in a pixbuf. - public virtual void set_background (Window window, StateType state_type)
Sets the background of
window
to the background color or pixmap specified by this for the given state.
Signals:
- public virtual signal void realize ()
Emitted when the style has been initialized for a particular visual.
- public virtual signal void unrealize ()
Emitted when the aspects of the style specific to a particular visual is being cleaned up.
Fields:
- public Color[] @base
- public unowned (unowned Pattern)[] background
- public Color[] bg
- public Color black
- public Color[] dark
- public Color[] fg
- public unowned FontDescription font_desc
- public Color[] light
- public Color[] mid
- public Color[] text
- public Color[] text_aa
- public Color white
- public int xthickness
- public int ythickness
Inherited Members:
All known members inherited from class GLib.Object