A Gtk.Style.Gtk_Style object encapsulates the information that provides the look and feel for a widget.
> In GTK+ 3.0, GtkStyle has been deprecated and replaced by > Gtk.Style_Context.Gtk_Style_Context.
Each Gtk.Widget.Gtk_Widget has an associated Gtk.Style.Gtk_Style object that is used when rendering that widget. Also, a Gtk.Style.Gtk_Style holds information for the five possible widget states though not every widget supports all five states; see Gtk.Enums.Gtk_State_Type.
Usually the Gtk.Style.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.Gtk_Style of their widgets.
procedure Apply_Default_Background
(Style : not null access Gtk_Style_Record;
Cr : Cairo.Cairo_Context;
Window : Gdk.Gdk_Window;
State_Type : Gtk.Enums.Gtk_State_Type;
X : Glib.Gint;
Y : Glib.Gint;
Width : Glib.Gint;
Height : Glib.Gint)
Deprecated since 3.0, 1
function Attach
(Style : not null access Gtk_Style_Record;
Window : Gdk.Gdk_Window) return Gtk_Style
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. Since this function may return a new object, you have to use it in the following way: style = gtk_style_attach (style, window) Deprecated since 3.0, 1
a Gdk.Gdk_Window.
Either Style, or a newly-created Gtk.Style.Gtk_Style. If the style is newly created, the style parameter will be unref'ed, and the new style will have a reference count belonging to the caller.
function Border_Get_Type return Glib.GType
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Style_Void is not null access procedure (Self : access Gtk_Style_Record'Class);
Context_Property : constant Glib.Properties.Property_Object;
Type: Gtk.Style_Context.Gtk_Style_Context
function Copy (Style : not null access Gtk_Style_Record) return Gtk_Style
Creates a copy of the passed in Gtk.Style.Gtk_Style object. Deprecated since 3.0, 1
a copy of Style
procedure Detach (Style : not null access Gtk_Style_Record)
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, 1
function From_Object_Free (B : access Gtk_Border) return Gtk_Border
A struct that specifies a border around a rectangular area that can be of different width on each side.
procedure Get_Style_Property
(Style : not null access Gtk_Style_Record;
Widget_Type : GType;
Property_Name : UTF8_String;
Value : out Glib.Values.GValue)
Queries the value of a style property corresponding to a widget class is in the given style. Since: gtk+ 2.16
the GType of a descendant of Gtk.Widget.Gtk_Widget
the name of the style property to get
a Glib.Values.GValue where the value of the property being queried will be stored
function Get_Type return Glib.GType
type Gtk_Border is record
Left : Gint16;
Right : Gint16;
Top : Gint16;
Bottom : Gint16;
end record;
function Gtk_Border_New return Gtk_Border
Allocates a new Gtk.Style.Gtk_Border-struct and initializes its elements to zero. Since: gtk+ 2.14
procedure Gtk_New (Self : out Gtk_Border)
Allocates a new Gtk.Style.Gtk_Border-struct and initializes its elements to zero. Since: gtk+ 2.14
procedure Gtk_New (Style : out Gtk_Style)
Creates a new Gtk.Style.Gtk_Style. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
type Gtk_Style is access all Gtk_Style_Record'Class;
function Gtk_Style_New return Gtk_Style
Creates a new Gtk.Style.Gtk_Style.
type Gtk_Style_Record is new GObject_Record with null record;
function Has_Context
(Style : not null access Gtk_Style_Record) return Boolean
Returns whether Style has an associated Gtk.Style_Context.Gtk_Style_Context. Since: gtk+ 3.0
True if Style has a Gtk.Style_Context.Gtk_Style_Context
procedure Initialize (Style : not null access Gtk_Style_Record'Class)
Creates a new Gtk.Style.Gtk_Style. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Lookup_Color
(Style : not null access Gtk_Style_Record;
Color_Name : UTF8_String;
Color : out Gdk.Color.Gdk_Color;
Found : out Boolean)
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 Gtk.Style.Gtk_Style and might change when a theme switch occurs. Since: gtk+ 2.10 Deprecated since 3.0, 1
the name of the logical color to look up
the Gdk.Color.Gdk_Color to fill in @return True if the mapping was found.
procedure On_Realize
(Self : not null access Gtk_Style_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
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.
procedure On_Realize
(Self : not null access Gtk_Style_Record;
Call : Cb_Gtk_Style_Void;
After : Boolean := False)
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.
procedure On_Unrealize
(Self : not null access Gtk_Style_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
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.Gtk_Style. This signal provides a convenient place to free such cached objects.
procedure On_Unrealize
(Self : not null access Gtk_Style_Record;
Call : Cb_Gtk_Style_Void;
After : Boolean := False)
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.Gtk_Style. This signal provides a convenient place to free such cached objects.
procedure Set_Background
(Style : not null access Gtk_Style_Record;
Window : Gdk.Gdk_Window;
State_Type : Gtk.Enums.Gtk_State_Type)
Sets the background of Window to the background color or pixmap specified by Style for the given state. Deprecated since 3.0, 1
a Gdk.Gdk_Window
a state
Signal_Realize : constant Glib.Signal_Name := "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.
Signal_Unrealize : constant Glib.Signal_Name := "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 Gtk.Style.Gtk_Style. This signal provides a convenient place to free such cached objects.