#define as callback data


Maybe this quesion has been posed already, but I am still 
looking for a better solution like this:

----begin common.h-------

#define OFF 0

----end common.h-------

----begin xmcm.c-------
#include "common.h"

static int off_cb = OFF;
   GTK_OBJECT( mm_off_radiobutton ), "clicked",
   GTK_SIGNAL_FUNC( mm_state_radiobutton_clicked ), &off_cb );

----end xmcm.c---------

-----begin mcm.c-------

void mm_state_radiobutton_clicked( GtkButton *button,
    gpointer data )
    if ( GTK_TOGGLE_BUTTON(button)->active )
        shm->mm_state = *((int *)(data));

----end mcm.c-------

What I would actually look for is to pass OFF directly to
gtk_signal_connect but (gpointer)(OFF) does not work

thanks for any hints,
Dr. Peter Wurmsdobler

      CTM - Centre de Transfert des Microtechniques
39, av. de l'Observatoire, BP-1445, 25007 Besancon CEDEX 3
TELEPHONE: +33 3 81 47 70 20  TELECOPIE: +33 3 81 47 70 21
         E-mail: peter wurmsdobler ctm-france com

                  Ceterum censeo MIRCOSOFTem esse delendam.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]