Index

Package: Connect_User_Data (generic)

Description

generic
      type User_Data_Type (<>) is private;
      with procedure Destroy (Data : in out User_Data_Type) is null;
   package Connect_User_Data is

Types

User_Data_Type

type User_Data_Type (<>) is private;

Gcallback

type Gcallback is access procedure (Data : User_Data_Type);
The type used for callback functions in structure definitions and function signatures. This doesn't mean that all callback functions must take no parameters and return void. The required signature of a callback function is determined by the context in which is used (e.g. the signal to which it is connected). Use G_CALLBACK to cast the callback function to a Gcallback.

Subprograms & Entries

Destroy

procedure Destroy 
(Data: in out User_Data_Type) is null;

Connect

function Connect 
(Self: not null access Glib.Cancellable.Gcancellable_Record'Class;
Callback: Gcallback;
Data: User_Data_Type;
Data_Destroy_Func: Glib.G_Destroy_Notify_Address) return Gulong;
Convenience function to connect to the Glib.Cancellable.Gcancellable::cancelled signal. Also handles the race condition that may happen if the cancellable is cancelled right before connecting. Callback is called at most once, either directly at the time of the connect if Cancellable is already cancelled, or when Cancellable is cancelled in some thread. Data_Destroy_Func will be called when the handler is disconnected, or immediately if the cancellable is already cancelled. See Glib.Cancellable.Gcancellable::cancelled for details on how to use this. Since: gtk+ 2.22 "callback": The Gcallback to connect. "data": Data to pass to Callback. "data_destroy_func": Free function for Data or null.