Index

Package: Style

Description

package Gtk.Style is

A Gtk.Style.Gtk_Style object encapsulates the information that provides the look and feel for a widget. <warning> In GTK+ 3.0, GtkStyle has been deprecated and replaced by Gtk.Style_Context.Gtk_Style_Context. </warning> 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.

Classes

Gtk_Style_Record

type Gtk_Style_Record is new GObject_Record with null record;

Ancestors:

Primitive operations:

Apply_Default_Background
Get_Style_Property
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Lookup_Color
On_Unrealize
On_Unrealize
Set_Background

Types

Gtk_Style

type Gtk_Style is access all Gtk_Style_Record'Class;

Gtk_Border

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

Cb_Gtk_Style_Void

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

Cb_GObject_Void

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

Constants & Global variables

Signal_Realize (Glib.Signal_Name)

Signal_Realize : constant Glib.Signal_Name := "realize";

Signal_Unrealize (Glib.Signal_Name)

Signal_Unrealize : constant Glib.Signal_Name := "unrealize";

Subprograms & Entries

From_Object_Free

function From_Object_Free 
(B: access Gtk_Border) return Gtk_Border;

Gtk_New

procedure Gtk_New 
(Style: out Gtk_Style);

Initialize

procedure Initialize 
(Style: not null access Gtk_Style_Record'Class);
Creates a new Gtk.Style.Gtk_Style.

Gtk_Style_New

function Gtk_Style_New return Gtk_Style;
Creates a new Gtk.Style.Gtk_Style.

Get_Type

function Get_Type return Glib.GType;

Gtk_New

procedure Gtk_New 
(Self: out Gtk_Border);
Allocates a new Gtk.Style.Gtk_Border structure and initializes its elements to zero. Since: gtk+ 2.14

Gtk_Border_New

function Gtk_Border_New return Gtk_Border;
Allocates a new Gtk.Style.Gtk_Border structure and initializes its elements to zero. Since: gtk+ 2.14

Border_Get_Type

function Border_Get_Type return Glib.GType;

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: Gint;
Y: Gint;
Width: Gint;
Height: Gint);

Attach

function Attach 
(Style: not null access Gtk_Style_Record;
Window: Gdk.Gdk_Window) return Gtk_Style;

Copy

function Copy 
(Style: not null access Gtk_Style_Record) return Gtk_Style;

Detach

procedure Detach 
(Style: not null access Gtk_Style_Record);

Get_Style_Property

procedure Get_Style_Property 
(Style: not null access Gtk_Style_Record;
Widget_Type: GType;
Property_Name: UTF8_String;
Value: in 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 "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

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

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);

Set_Background

procedure Set_Background 
(Style: not null access Gtk_Style_Record;
Window: Gdk.Gdk_Window;
State_Type: Gtk.Enums.Gtk_State_Type);

On_Realize

procedure On_Realize 
(Self: not null access Gtk_Style_Record;
Call: Cb_Gtk_Style_Void;
After: Boolean := False);

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.

On_Unrealize

procedure On_Unrealize 
(Self: not null access Gtk_Style_Record;
Call: Cb_Gtk_Style_Void;
After: Boolean := False);

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.