Index

Package: User_Data (generic)

Description

generic
      type Data_Type (<>) is private;
   package User_Data is

Types

Data_Type

type Data_Type (<>) is private;

On_Destroyed_Callback

type On_Destroyed_Callback is access procedure (Data : Data_Type);
On_Destroyed is called when the data is overriden in the object, by an other object with the same ID, or when the object itself is destroyed

Subprograms & Entries

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.

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.

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

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.

Remove

procedure Remove 
(Object: access GObject_Record'Class;
Id: String := "user_data");
Remove some data from the object

Get

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

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.

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.

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.