next up previous contents
Next: GDK - Gimp Drawing Up: Using GTK Previous: Widgets   Contents

Advanced data manipulation

Signals an call-backs technology is very flexible and clear to develop and maintain. But there is a need for data to be accessed from many call-backs and arranged to a specified widget.

GTK solves this problem too. There are the following three functions:

     void gtk_object_set_data( GtkObject *object,
                               const gchar *key,
                               gpointer data);

     gpointer gtk_object_get_data( GtkObject *object,
                                   const gchar *key);

     void gtk_object_remove_data( GtkObject *object,
                                  const gchar *key);

They let set, get and remove an association from string to pointer for a given object.

When there is a need to associate some data with a given object, these functions could be used which reduces number of global variables and simplifies the development processes.

This technology is used by the Editor module, in Properties window, to notify which cell was clicked the last.



Igor Wojnicki 2001-02-21