#define as callback data
- From: Peter Wurmsdobler <peter wurmsdobler ctm-france com>
- To: gtk-app-devel-list gnome org
- Subject: #define as callback data
- Date: Tue, 26 Jun 2001 17:47:41 +0200
Hello,
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_signal_connect(
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,
peterw
-
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]