Re: Transmit an array to a function



>In fact, it's not the point. The pb is that I can transmit widget[1]
>without any pb but I can't transmit the whole array in the same call.
>Idem if I want to transmit an array of char:
>
>char *caract[20];
>gtk_signal_connect
>(GTK_OBJECT(button),"clicked",GTK_SIGNAL_FUNC(function),(gpointer)carac);
><-- won't work
>gtk_signal_connect
>(GTK_OBJECT(button),"clicked",GTK_SIGNAL_FUNC(function),(gpointer)carac[1]);
><-- will work
>(Of course, I change the receiving function to sync with the call)
>
>So, I am really lost... It must exist a solution to transmit an array of
>any type, no?

Did you try:

gtk_signal_connect
(GTK_OBJECT(button),"clicked",GTK_SIGNAL_FUNC(function),(gpointer)&carac[0]);

standard C technique, nothing GTK+ specific about it.

--p




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