Click to See Complete Forum and Search --> : gtk_init_add()


veeco
09-16-2002, 12:27 PM
I've problem with this function:

void gtk_init_add(GtkFunction function, gpointer data)

I've no idea about GtkFunction. Can anyone give me some explaination / reference on this or an example if any. Thanks a lot.

binaryDigit
09-16-2002, 06:26 PM
GtkFunction is a pointer to a function. that's it.
you'll see that alot when connecting signals.

veeco
09-17-2002, 02:17 PM
Thanks binaryDigit, I got it. I went through some examples on connecting signals and found that they use GTK_SIGNAL_FUNC(). Well, I'm clear on that part. But I still can't get this gtk_init_add() work because there is no such a function called GTK_FUNCTION(), am I right?

I have this function: void start_master_server()
So, how can I put this "start_master_server" into gtk_init_add()?

binaryDigit
09-17-2002, 05:43 PM
GTK_FUNCTION is the same as GtkFunction *

well to add a function with gtk_init_add my guess would be

where some_data is gpointer...

gtk_init_add(GTK_FUNCTION(start_master_server), some_data);

should do it.

could also do it like:

gtk_init_add(GtkFunction *(start_master_server), some_data);

(that might be right. just guessing right now)

veeco
09-18-2002, 12:28 PM
well, i've both GTK_FUNCTION and GtkFunction * and i got error for both of that.
GTK_FUNCTION: undefined reference to GTK_FUNCTION
(i've included <gtk/gtk.h>

GtkFunction *: parse error before GtkFunction
(I'm not very clear on this error)

I try to get some information from Gtk Reference Manual but it's incomplete.
by the way, thanks again binaryDigit.