[fpc-pascal] FP/GTK-GLib : Sending/Accessing Callback GPointer data ?

T. Guilleminot tom at guilleminot.org
Wed Aug 6 12:15:01 CEST 2008


I'd like to be able to pass/access variable(s ?) to/from the "data" part
of the "g_signal_connect" function, eg :

    Procedure MyActionProcedure (widget : pGtkWidget ; data : gpointer)
      ... // Using data content here...
    g_signal_connect (G_OBJECT(pMyButton), 'button-release-event',
G_CALLBACK(@MyActionProcedure), MyData);
    // Passing information here

However I'm unable to handle it once MyActionProcedure called.

  - Does anyone have a *simple* example to do this ? I can only find C
sample on the web.
  - Is "data" able to store single or multiple (and different) variable ?
  - If multiple variables possible, can they be of different types
(integer, string...) ?

Thanks !

More information about the fpc-pascal mailing list