Glib.Object.User_Data

Entities

Generic formal parameters

Access Types

Subprograms

Description

<doc_ignore>

Data_Type

type Data_Type (<>) is private;

Free_Data

procedure Free_Data (Data : System.Address)

Internal procedure used to free user data in the package body

Parameters
Data

Get

function Get
  (Object : access GObject_Record'Class;
   Id     : Glib.GQuark) return Data_Type

Same function as Get above, but uses directly the Quark associated with the string, which speeds up the access time significantly.

Parameters
Object
Id
Return Value

Get

function Get
  (Object  : access GObject_Record'Class;
   Id      : Glib.GQuark;
   Default : Data_Type) return Data_Type

Same function as Get above, but uses directly the Quark associated with the string, which speeds up the access time significantly.

Parameters
Object
Id
Default
Return Value

Get

function Get
  (Object : access GObject_Record'Class;
   Id     : String := "user_data") return Data_Type

Get the information associated with the key ID. Raise Gtkada.Types.Data_Error if there is none.

Parameters
Object
Id
Return Value

Get

function Get
  (Object  : access GObject_Record'Class;
   Id      : String := "user_data";
   Default : Data_Type) return Data_Type

Get the information associated with the key ID. Return Default instead of raising an exception if there is no such user data

Parameters
Object
Id
Default
Return Value

Is_Set

function Is_Set
  (Object : access GObject_Record'Class;
   Id     : String := "user_data") return Boolean

Whether the given user data was set on the object.

Parameters
Object
Id
Return Value

On_Destroyed_Callback

type On_Destroyed_Callback is access procedure (Data : Data_Type);

On_Destroyed is called when the data is overridden in the object, by an other object with the same ID, or when the object itself is destroyed

Parameters
Data

Remove

procedure Remove
  (Object : access GObject_Record'Class; Id : Glib.GQuark)

Same function as Remove above, but uses directly the Quark associated with the string, which speeds up the access time significantly.

Parameters
Object
Id

Remove

procedure Remove
  (Object : access GObject_Record'Class; Id : String := "user_data")

Remove some data from the object

Parameters
Object
Id

Set

procedure Set
  (Object : access GObject_Record'Class;
   Data   : Data_Type;
   Id     : Glib.GQuark;
   On_Destroyed : On_Destroyed_Callback := null)

Same function as Set above, but uses directly the Quark associated with the string, which speeds up the access time significantly.

Parameters
Object
Data
Id
On_Destroyed

Set

procedure Set
  (Object : access GObject_Record'Class;
   Data   : Data_Type;
   Id     : String := "user_data";
   On_Destroyed : On_Destroyed_Callback := null)

Associate some new user data with the object. The strings starting with "gtkada_" are reserved for GtkAda's internal use, please avoid using them.

Parameters
Object
Data
Id
On_Destroyed