Signaux

Signaux — Méthodes d'objet et callbacks

Synopsis

#include <gtk/gtk.h>


#define GTK_SIGNAL_OFFSET
enum GtkSignalRunType;
guint gtk_signal_new (const gchar *name,
GtkSignalRunType signal_flags,
GtkType object_type,
guint function_offset,
GtkSignalMarshaller marshaller,
GtkType return_val,
guint n_args,
...);
guint gtk_signal_newv (const gchar *name,
GtkSignalRunType signal_flags,
GtkType object_type,
guint function_offset,
GtkSignalMarshaller marshaller,
GtkType return_val,
guint n_args,
GtkType *args);
#define gtk_signal_lookup (name,object_type)
#define gtk_signal_name (signal_id)
void gtk_signal_emit (GtkObject *object,
guint signal_id,
...);
void gtk_signal_emit_by_name (GtkObject *object,
const gchar *name,
...);
void gtk_signal_emitv (GtkObject *object,
guint signal_id,
GtkArg *args);
void gtk_signal_emitv_by_name (GtkObject *object,
const gchar *name,
GtkArg *args);
#define gtk_signal_emit_stop (object,signal_id)
void gtk_signal_emit_stop_by_name (GtkObject *object,
const gchar *name);
#define gtk_signal_connect (object,name,func,func_data)
#define gtk_signal_connect_after (object,name,func,func_data)
#define gtk_signal_connect_object (object,name,func,slot_object)
#define gtk_signal_connect_object_after (object,name,func,slot_object)
gulong gtk_signal_connect_full (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GtkCallbackMarshal unsupported,
gpointer data,
GtkDestroyNotify destroy_func,
gint object_signal,
gint after);
void gtk_signal_connect_while_alive (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
gpointer func_data,
GtkObject *alive_object);
void gtk_signal_connect_object_while_alive
(GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GtkObject *alive_object);
#define gtk_signal_disconnect (object,handler_id)
#define gtk_signal_disconnect_by_func (object,func,data)
#define gtk_signal_disconnect_by_data (object,data)
#define gtk_signal_handler_block (object,handler_id)
#define gtk_signal_handler_block_by_func (object,func,data)
#define gtk_signal_handler_block_by_data (object,data)
#define gtk_signal_handler_unblock (object,handler_id)
#define gtk_signal_handler_unblock_by_func (object,func,data)
#define gtk_signal_handler_unblock_by_data (object,data)
#define gtk_signal_handler_pending (object,signal_id,may_be_blocked)
#define gtk_signal_handler_pending_by_func (object,signal_id,may_be_blocked,func,data)
#define gtk_signal_default_marshaller

Description

Le système de signaux de GTK+  donne simplement le pouvoir du système de signaux de GLib. Pour un usage futur, l'utilisation directe de l'API  GSignal  est recommandé, cela évite des coût d'exécution importants quand les structures  GtkArg doivent être converties en GValues.

Qu'est ce qu'un signal ?

Les signaux sont une façon de capter les notifications quand quelque chose arrive et pour modifier le comportement des objets en apportant ce que l'utilisateur veut. Tout signal est identifié de façon unique par un nom, "nom_classe::nom_signal", où nom_signal doit être quelque chose comme  "clicked" et nom_classe doit être "GtkButton". Notez que certaines autres classes peuvent aussi définir un callback "clicked",  à condition qu'il ne dérive pas de GtkButton.

Quand ils sont créés, ils sont aussi assignés à un entier positif unique, l'id du signal (1 est le premier signal, l'id -0 est utilisé pour signaler une erreur). Chaque signal est aussi attaché à un tableau de types qui décrit le prototype du ou des pointeur(s) de fonction (handlers) que vous devez connecter au signal. Finalement, chaque signal a un gestionnaire par défaut (handler) qui est donnée par le pointeur de fonction  dans sa structure de classe : il est exécuté par défaut quand le signal est émis. ( Il est possible qu'un signal soit émis et qu'un gestionnaire définit par l'utilisateur empêche le gestionnaire par défaut d'être exécuté.)

Les signaux sont utilisés par tout le monde, mais ils sont créés uniquement à partir d'un classe de base (on a per class basis) -- aussi vous ne devez pas appeler  gtk_signal_new() sans écrire un nouveau type  GtkObject. Autrement, si vous voulez créer un nouveau signal pour un type existant, vous devez utiliser  gtk_object_class_user_signal_new() pour créer un signal qui ne correspondra pas aux méthodes de construction de classe.


Comment les signaux sont-ils utilisés?

Il y a deux actions de base dans le jeu de manipulation d'un signal. Si vous voulez notifier d'un événement, vous devez connecter un pointeur de fonction et un pointeur de données à un signal; le pointeur de données sera pasé comme dernier argument de la fonction ( à condition que vous utilisiez les fonctions de triage (marshalling) par défaut). Vous recevrez un identifiant id de connexion, un entier unique et positif qui correspondra à cette connexion.

Les fonctions qui veulent notifier à l'utilisateur certaines actions, émettent des signaux..


Terminologie de Base

signal

Une méthode de classe, par exemple GtkButton::clicked. Plus précisément c'est une paire classe-branche/nom-signal unique.Cela signifie que vous devez définir un gestionnaire de signal pour une classe qui dérive de  GtkButton  et qui  est appelé "clicked", mais il est possible de partager les nom de signaux  s'il sont séparés dans l'arbre des classes.

gestionnaire par défaut

Méthode interne d'objet qui sera appelée quand le signal sera émis.

gestionnaire
défini par l'utilisateur

Un pointeur de fonction et des données connectés au signal (pour un objet particulier).

En réalité il y en a  deux types :  ceux qui sont connectés normalement, et ceux qui  sont connectés par une des fonctions (connect-after) . Les gestionnaires "connectés après" sont toujours exécutés après le gestionnaire par défaut.

Nombreuses trousses d'outils se rapportant à cela comme les callbacks.

émission

le porcessus  entier d'émission de signal, incluant l'invocation de tous les types différents de gestionnaires mentionnés plus haut.

id du signal 

L'entier unique et positif ( non zéro) utilisé pour identifier le signal. Il peut être utilisé à la place d'un nom dans beaucoup de fonctions pour une légère amélioration à l'exécution.

id de connexion 

L'entier unique et positif (non zéro) utilisé pour identifier la connecxion d'un gestionnaire défini par l'utilisateur à un signal. Notez qu'il est affecté pour connecter aussi bien la paire fonction-pointeur que la paire utilisateur-données (??), aussi il n'y a pas de garantie pour qu' une paire fonction-pointeur/ utilisateur- données corresponde à un id de connexion unique.


Note brève sur comment ça marche.

Les fonctions responsables de la traduction des tableaux de GtkArgs dans la sémantique normale de votre compilateur C sont appelées des Marshallers. Elle sont identifiées par gtk_marshal_return_value__parameter_list() par exemple une fonction C retournant un gboolean et prenant un  gint  peut être appelée  gtk_marshal_BOOL__INT(). Toutes les combinaisons possibles de retourné/ paramètre ne sont pas valables, bien sûr, aussi si vous avez écrit un GtkObject avec des paramètres vous pouvez avoir à écrire un  marshaller.

Details

GTK_SIGNAL_OFFSET


#define GTK_SIGNAL_OFFSET	                      GTK_STRUCT_OFFSET

Attention

GTK_SIGNAL_OFFSET est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.

Utilisez à la place de  offsetof(), qui est utilisé s'il existe.


enum GtkSignalRunType


typedef enum			/*< flags >*/
{
GTK_RUN_FIRST = G_SIGNAL_RUN_FIRST,
GTK_RUN_LAST = G_SIGNAL_RUN_LAST,
GTK_RUN_BOTH = (GTK_RUN_FIRST | GTK_RUN_LAST),
GTK_RUN_NO_RECURSE = G_SIGNAL_NO_RECURSE,
GTK_RUN_ACTION = G_SIGNAL_ACTION,
GTK_RUN_NO_HOOKS = G_SIGNAL_NO_HOOKS
} GtkSignalRunType;

Attention

GtkSignalRunType est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.

Configure l'émission du signal et contrôle si le signal peut être émis de façon récursive sur un objet et s'il faut exécuter la méthode par défaut avant ou après le gestionnaire défini par l'utilisateur. 

GTK_RUN_FIRST

Exécute le gestionnaire pas défaut avant le gestionnaire définit par l'utilisateur qui est connecté.

GTK_RUN_LAST

Run the default handler after the connected user-defined handlers. (Handlers registered as "after" always run after the default handler though)

GTK_RUN_BOTH

Run the default handler twice, once before the user-defined handlers, and once after.

GTK_RUN_NO_RECURSE

Whether to prevent a handler or hook from reemitting the signal from within itself. Attempts to emit the signal while it is running will result in the signal emission being restarted once it is done with the current processing.

You must be careful to avoid having two handlers endlessly reemitting signals, gtk_signal_n_emissions() can be helpful.

GTK_RUN_ACTION

The signal is an action you can invoke without any particular setup or cleanup. The signal is treated no differently, but some other code can determine if the signal is appropriate to delegate to user control. For example, key binding sets only allow bindings of ACTION signals to keystrokes.

GTK_RUN_NO_HOOKS

This prevents the connection of emission hooks to the signal.


gtk_signal_new ()


guint gtk_signal_new (const gchar *name,
GtkSignalRunType signal_flags,
GtkType object_type,
guint function_offset,
GtkSignalMarshaller marshaller,
GtkType return_val,
guint n_args,
...);

Attention

gtk_signal_new est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_new() instead.

Creates a new signal type. (This is usually done in the class initializer.)

name : the event name for the signal, e.g. "clicked".
signal_flags : a combination of GTK_RUN flags specifying detail of when the default handler is to be invoked. You should at least specify GTK_RUN_FIRST or GTK_RUN_LAST.
object_type : the type of object this signal pertains to. It will also pertain to derivers of this type automatically.
function_offset : How many bytes the function pointer is in the class structure for this type. Used to invoke a class method generically.
marshaller : the function to translate between an array of GtkArgs and the native calling convention. Usually they are identified just by the type of arguments they take: for example, gtk_marshal_BOOL__STRING() describes a marshaller which takes a string and returns a boolean value.
return_val : the type of return value, or GTK_TYPE_NONE for a signal without a return value.
n_args : the number of parameter the handlers may take.
... : a list of GTK_TYPE_*, one for each parameter.
Returns : the signal id.

gtk_signal_newv ()


guint gtk_signal_newv (const gchar *name,
GtkSignalRunType signal_flags,
GtkType object_type,
guint function_offset,
GtkSignalMarshaller marshaller,
GtkType return_val,
guint n_args,
GtkType *args);

Attention

gtk_signal_newv est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_newv() instead.

Creates a new signal type. (This is usually done in a class initializer.)

This function take the types as an array, instead of a list following the arguments. Otherwise the same as gtk_signal_new().

name : the name of the signal to create.
signal_flags : see gtk_signal_new().
object_type : the type of GtkObject to associate the signal with.
function_offset : how many bytes the function pointer is in the class structure for this type.
marshaller :
return_val : the type of the return value, or GTK_TYPE_NONE if you don't want a return value.
n_args : the number of parameters to the user-defined handlers.
args : an array of GtkTypes, describing the prototype to the callbacks.
Returns : the signal id.

gtk_signal_lookup()


#define gtk_signal_lookup(name,object_type)

Attention

gtk_signal_lookup est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_lookup() instead.

Given the name of the signal and the type of object it connects to, get the signal's identifying integer. Emitting the signal by number is somewhat faster than using the name each time.

It also tries the ancestors of the given type.

name : the signal's name, e.g. clicked.
object_type : the type that the signal operates on, e.g. GTK_TYPE_BUTTON.
Returns : the signal's identifying number, or 0 if no signal was found.

gtk_signal_name()


#define gtk_signal_name(signal_id)

Attention

gtk_signal_name est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_name() instead.

Given the signal's identifier, finds its name.

Two different signals may have the same name, if they have differing types.

signal_id : the signal's identifying number.
Returns : the signal name, or NULL if the signal number was invalid.

gtk_signal_emit ()


void gtk_signal_emit (GtkObject *object,
guint signal_id,
...);

Attention

gtk_signal_emit est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_emit() instead.

Emits a signal. This causes the default handler and user-defined handlers to be run.

Here is what gtk_signal_emit() does:

1. Calls the default handler and the user-connected handlers. The default handler will be called first if GTK_RUN_FIRST is set, and last if GTK_RUN_LAST is set.

2. Calls all handlers connected with the "after" flag set.

object : the object that emits the signal.
signal_id : the signal identifier.
... : the parameters to the function, followed by a pointer to the return type, if any.

gtk_signal_emit_by_name ()


void gtk_signal_emit_by_name (GtkObject *object,
const gchar *name,
...);

Attention

gtk_signal_emit_by_name est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_emit_by_name() instead.

Emits a signal. This causes the default handler and user-connected handlers to be run.

object : the object that emits the signal.
name : the name of the signal.
... : the parameters to the function, followed by a pointer to the return type, if any.

gtk_signal_emitv ()


void gtk_signal_emitv (GtkObject *object,
guint signal_id,
GtkArg *args);

Attention

gtk_signal_emitv est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_emitv() instead.

Emits a signal. This causes the default handler and user-connected handlers to be run. This differs from gtk_signal_emit() by taking an array of GtkArgs instead of using C's varargs mechanism.

object : the object to emit the signal to.
signal_id : the signal identifier.
args : an array of GtkArgs, one for each parameter, followed by one which is a pointer to the return type.

gtk_signal_emitv_by_name ()


void gtk_signal_emitv_by_name (GtkObject *object,
const gchar *name,
GtkArg *args);

Attention

gtk_signal_emitv_by_name est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_emitv() and g_signal_lookup() instead.

Emits a signal by name. This causes the default handler and user-connected handlers to be run. This differs from gtk_signal_emit() by taking an array of GtkArgs instead of using C's varargs mechanism.

object : the object to emit the signal to.
name : the name of the signal.
args : an array of GtkArgs, one for each parameter, followed by one which is a pointer to the return type.

gtk_signal_emit_stop()


#define gtk_signal_emit_stop(object,signal_id)

Attention

gtk_signal_emit_stop est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_stop_emission() instead.

This function aborts a signal's current emission.

It will prevent the default method from running, if the signal was GTK_RUN_LAST and you connected normally (i.e. without the "after" flag).

It will print a warning if used on a signal which isn't being emitted.

object : the object whose signal handlers you wish to stop.
signal_id : the signal identifier, as returned by g_signal_lookup().

gtk_signal_emit_stop_by_name ()


void gtk_signal_emit_stop_by_name (GtkObject *object,
const gchar *name);

Attention

gtk_signal_emit_stop_by_name est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_stop_emission_by_name() instead.

This function aborts a signal's current emission.

It is just like gtk_signal_emit_stop() except it will lookup the signal id for you.

object : the object whose signal handlers you wish to stop.
name : the name of the signal you wish to stop.

gtk_signal_connect()


#define gtk_signal_connect(object,name,func,func_data)

Attention

gtk_signal_connect est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_connect() instead.

Attaches a function pointer and user data to a signal for a particular object.

The GtkSignalFunction takes a GtkObject as its first parameter. It will be the same object as the one you're connecting the hook to. The func_data will be passed as the last parameter to the hook.

All else being equal, signal handlers are invoked in the order connected (see gtk_signal_emit() for the other details of which order things are called in).

Here is how one passes an integer as user data, for when you just want to specify a constant int as parameter to your function:

static void button_clicked_int (GtkButton* button, gpointer func_data)
{
g_print ("button pressed: %d\n", GPOINTER_TO_INT (func_data));
}
/* By calling this function, you will make the g_print above
* execute, printing the number passed as `to_print'. */
static void attach_print_signal (GtkButton* button, gint to_print)
{
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (button_clicked_int),
GINT_TO_POINTER (to_print));
}
object : the object associated with the signal, e.g. if a button is getting pressed, this is that button.
name : name of the signal.
func : function pointer to attach to the signal.
func_data : value to pass as to your function (through the marshaller).
Returns : the connection id.

gtk_signal_connect_after()


#define gtk_signal_connect_after(object,name,func,func_data)

Attention

gtk_signal_connect_afterest déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_connect_after() instead.

Attaches a function pointer and user data to a signal so that this handler will be called after the other handlers.

object : the object associated with the signal.
name : name of the signal.
func : function pointer to attach to the signal.
func_data : value to pass as to your function (through the marshaller).
Returns : the unique identifier for this attachment: the connection id.

gtk_signal_connect_object()

#define gtk_signal_connect_object(object,name,func,slot_object)







Attention

gtk_signal_connect_objectest déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_connect_swapped() instead.

This function is for registering a callback that will call another object's callback. That is, instead of passing the object which is responsible for the event as the first parameter of the callback, it is switched with the user data (so the object which emits the signal will be the last parameter, which is where the user data usually is).

This is useful for passing a standard function in as a callback. For example, if you wanted a button's press to gtk_widget_show() some widget, you could write:

gtk_signal_connect_object (button, "clicked", gtk_widget_show, window);
object : the object which emits the signal.
name : the name of the signal.
func : the function to callback.
slot_object : the object to pass as the first parameter to func. (Though it pretends to take an object, you can really pass any gpointer as the slot_object .)
Returns : the connection id.

gtk_signal_connect_object_after()


#define gtk_signal_connect_object_after(object,name,func,slot_object)

Attention

gtk_signal_connect_object_afterest déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_connect_data() instead, passing G_CONNECT_AFTER|G_CONNECT_SWAPPED as connect_flags.

Attaches a signal hook to a signal, passing in an alternate object as the first parameter, and guaranteeing that the default handler and all normal handlers are called first.

object : the object associated with the signal.
name : name of the signal.
func : function pointer to attach to the signal.
slot_object : the object to pass as the first parameter to func.
Returns : the connection id.

gtk_signal_connect_full ()



gulong gtk_signal_connect_full (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GtkCallbackMarshal unsupported,
gpointer data,
GtkDestroyNotify destroy_func,
gint object_signal,
gint after);

Attention

gtk_signal_connect_full est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_connect_data() instead.

Attaches a function pointer and user data to a signal with more control.

object : the object which emits the signal. For example, a button in the button press signal.
name : the name of the signal.
func : function pointer to attach to the signal.
unsupported :
data : the user data associated with the function.
destroy_func : function to call when this particular hook is disconnected.
object_signal : whether this is an object signal-- basically an "object signal" is one that wants its user_data and object fields switched, which is useful for calling functions which operate on another object primarily.
after : whether to invoke the user-defined handler after the signal, or to let the signal's default behavior preside (i.e. depending on GTK_RUN_FIRST and GTK_RUN_LAST).
Returns : the connection id.

gtk_signal_connect_while_alive ()


void gtk_signal_connect_while_alive (GtkObject *object,
const gchar *name,
GtkSignalFunc func,
gpointer func_data,
GtkObject *alive_object);

Attention

gtk_signal_connect_while_aliveest déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_connect_object() instead.

Attaches a function pointer and another GtkObject to a signal.

This function takes an object whose "destroy" signal should be trapped. That way, you don't have to clean up the signal handler when you destroy the object. It is a little less efficient though.

(Instead you may call gtk_signal_disconnect_by_data(), if you want to explicitly delete all attachments to this object. This is perhaps not recommended since it could be confused with an integer masquerading as a pointer (through GINT_TO_POINTER()).)

object : the object that emits the signal.
name : name of the signal.
func : function pointer to attach to the signal.
func_data : pointer to pass to func.
alive_object : object whose death should cause the handler connection to be destroyed.

gtk_signal_connect_object_while_alive ()


void gtk_signal_connect_object_while_alive
(GtkObject *object,
const gchar *name,
GtkSignalFunc func,
GtkObject *alive_object);

Attention

gtk_signal_connect_object_while_alive est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_connect_object() instead, passing G_CONNECT_SWAPPED as connect_flags.

These signal connectors are for signals which refer to objects, so they must not be called after the object is deleted.

Unlike gtk_signal_connect_while_alive(), this swaps the object and user data, making it suitable for use with functions which primarily operate on the user data.

This function acts just like gtk_signal_connect_object() except it traps the "destroy" signal to prevent you from having to clean up the handler.

object : the object associated with the signal.
name : name of the signal.
func : function pointer to attach to the signal.
alive_object : the user data, which must be an object, whose destruction should signal the removal of this signal.

gtk_signal_disconnect()


#define gtk_signal_disconnect(object,handler_id)

Attention

gtk_signal_disconnect est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handler_disconnect() instead.

Destroys a user-defined handler connection.

object : the object which the handler pertains to.
handler_id : the connection id.

gtk_signal_disconnect_by_func()


#define gtk_signal_disconnect_by_func(object,func,data)

Attention

gtk_signal_disconnect_by_func est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handlers_disconnect_by_func() instead.

Destroys all connections for a particular object, with the given function-pointer and user-data.

object : the object which emits the signal.
func : the function pointer to search for.
data : the user data to search for.

gtk_signal_disconnect_by_data()


#define gtk_signal_disconnect_by_data(object,data)

Attention

gtk_signal_disconnect_by_dataest déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_handlers_disconnect_matched() instead.

Destroys all connections for a particular object, with the given user-data.

object : the object which emits the signal.
data : the user data to search for.

gtk_signal_handler_block()


#define gtk_signal_handler_block(object,handler_id)

Attention

gtk_signal_handler_block est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.Use g_signal_handler_block() instead.

Prevents a user-defined handler from being invoked. All other signal processing will go on as normal, but this particular handler will ignore it.

object : the object which emits the signal to block.
handler_id : the connection id.

gtk_signal_handler_block_by_func()


#define gtk_signal_handler_block_by_func(object,func,data)

Attention

gtk_signal_handler_block_by_func est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handlers_block_by_func() instead.

Prevents a user-defined handler from being invoked, by reference to the user-defined handler's function pointer and user data. (It may result in multiple hooks being blocked, if you've called connect multiple times.)

object : the object which emits the signal to block.
func : the function pointer of the handler to block.
data : the user data of the handler to block.

gtk_signal_handler_block_by_data()


#define gtk_signal_handler_block_by_data(object,data)

Attention

gtk_signal_handler_block_by_dataest déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handlers_block_matched() instead.

Prevents all user-defined handlers with a certain user data from being invoked.

object : the object which emits the signal we want to block.
data : the user data of the handlers to block.

gtk_signal_handler_unblock()


#define gtk_signal_handler_unblock(object,handler_id)

Attention

gtk_signal_handler_unblock est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handler_unblock() instead.

Undoes a block, by connection id. Note that undoing a block doesn't necessarily make the hook callable, because if you block a hook twice, you must unblock it twice.

object : the object which emits the signal we want to unblock.
handler_id : the emission handler identifier, as returned by gtk_signal_connect(), etc.

gtk_signal_handler_unblock_by_func()


#define gtk_signal_handler_unblock_by_func(object,func,data)

Attention

gtk_signal_handler_unblock_by_func est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handlers_unblock_by_func() instead.

Undoes a block, by function pointer and data. Note that undoing a block doesn't necessarily make the hook callable, because if you block a hook twice, you must unblock it twice.

object : the object which emits the signal we want to unblock.
func : the function pointer to search for.
data : the user data to search for.

gtk_signal_handler_unblock_by_data()


#define gtk_signal_handler_unblock_by_data(object,data)

Attention

gtk_signal_handler_unblock_by_data est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_handlers_unblock_matched() instead.

Undoes block(s), to all signals for a particular object with a particular user-data pointer

object : the object which emits the signal we want to unblock.
data : the user data to search for.

gtk_signal_handler_pending()


#define gtk_signal_handler_pending(object,signal_id,may_be_blocked)

Attention

gtk_signal_handler_pending est déprécié et ne doit plus être utilisé avec un code nouvellement écrit. Use g_signal_has_handler_pending() instead.

Returns a connection id corresponding to a given signal id and object.

One example of when you might use this is when the arguments to the signal are difficult to compute. A class implementor may opt to not emit the signal if no one is attached anyway, thus saving the cost of building the arguments.

object : the object to search for the desired user-defined handler.
signal_id : the number of the signal to search for.
may_be_blocked : whether it is acceptable to return a blocked handler.
Returns : the connection id, if a connection was found. 0 otherwise.

gtk_signal_handler_pending_by_func()


#define gtk_signal_handler_pending_by_func(object,signal_id,may_be_blocked,func,data)

Attention

gtk_signal_handler_pending_by_func est déprécié et ne doit plus être utilisé avec un code nouvellement écrit.

Returns a connection id corresponding to a given signal id, object, function pointer and user data.

object : the object to search for the desired handler.
signal_id : the number of the signal to search for.
may_be_blocked : whether it is acceptable to return a blocked handler.
func : the function pointer to search for.
data : the user data to search for.
Returns : the connection id, if a handler was found. 0 otherwise.

gtk_signal_default_marshaller


#define gtk_signal_default_marshaller g_cclosure_marshal_VOID__VOID

Attention

gtk_signal_default_marshallerest déprécié et ne doit plus être utilisé avec un code nouvellement écrit.

A marshaller that returns void and takes no extra parameters.

See Also

GtkObject

The base class for things which emit signals.

GSignal

The GLib signal system.