Gtk.Style

Entities

Record Types

Tagged Types

Access Types

Constants

Subprograms

Description

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.

Apply_Default_Background

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

Parameters
Style
Cr
Window
State_Type
X
Y
Width
Height

Attach

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

Parameters
Style
Window

a Gdk.Gdk_Window.

Return Value

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.

Border_Get_Type

function Border_Get_Type return Glib.GType
Return Value

Cb_GObject_Void

type Cb_GObject_Void is not null access procedure
  (Self : access Glib.Object.GObject_Record'Class);
Parameters
Self

Cb_Gtk_Style_Void

type Cb_Gtk_Style_Void is not null access procedure (Self : access Gtk_Style_Record'Class);
Parameters
Self

Context_Property

Context_Property : constant Glib.Properties.Property_Object;

Type: Gtk.Style_Context.Gtk_Style_Context

Copy

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

Parameters
Style
Return Value

a copy of Style

Detach

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

Parameters
Style

From_Object_Free

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.

Parameters
B
Return Value

Get_Style_Property

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

Parameters
Style
Widget_Type

the GType of a descendant of Gtk.Widget.Gtk_Widget

Property_Name

the name of the style property to get

Value

a Glib.Values.GValue where the value of the property being queried will be stored

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_Border

type Gtk_Border is record
   Left : Gint16;
   Right : Gint16;
   Top : Gint16;
   Bottom : Gint16;
end record;
Record fields
Left
Right
Top
Bottom

Gtk_Border_New

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

Return Value

Gtk_New

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

Parameters
Self

Gtk_New

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.

Parameters
Style

Gtk_Style

type Gtk_Style is access all Gtk_Style_Record'Class;

Gtk_Style_New

function Gtk_Style_New return Gtk_Style

Creates a new Gtk.Style.Gtk_Style.

Return Value

Gtk_Style_Record

type Gtk_Style_Record is new GObject_Record with null record;

Has_Context

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

Parameters
Style
Return Value

True if Style has a Gtk.Style_Context.Gtk_Style_Context

Initialize

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.

Parameters
Style

Lookup_Color

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

Parameters
Style
Color_Name

the name of the logical color to look up

Color

the Gdk.Color.Gdk_Color to fill in @return True if the mapping was found.

Found

On_Realize

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.

Parameters
Self
Call
Slot
After

On_Realize

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.

Parameters
Self
Call
After

On_Unrealize

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.

Parameters
Self
Call
Slot
After

On_Unrealize

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.

Parameters
Self
Call
After

Set_Background

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

Parameters
Style
Window

a Gdk.Gdk_Window

State_Type

a state

Signal_Realize

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

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.