## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: User_Data (generic)

- Goto spec source

# Description

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

# Types

### Data_Type

- Goto declaration in source

    type Data_Type (<>) is private;

### On_Destroyed_Callback

- Goto declaration in source

    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

### Get

- Goto spec in source

    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

- Goto spec in source

    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

- Goto spec in source

    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

- Goto spec in source

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

Remove some data from the object

### Get

- Goto spec in source

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

### Get

- Goto spec in source

    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

- Goto spec in source

    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

- Goto spec in source

    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.