Re: [gtk-list] How to use a gpointer?



..........

as far as gpointer is void*:

gtk_signal_connect(GTK_OBJECT(button),"clicked",
GTK_SIGNAL_FUNC(handle_value),(gpointer)(&value));

> .
> .
> .
> static void handle_value(GtkWidget *widget,gpointer data)
> {
> int the_value;
> 
> the_value=??????data; 
and the_value=*((int*)date);
This should work.

No, it didn't. What do you mean with "as far as gpointer is void*"?
Can you maybe give me another example, how you can pass an int into a
GTK_SIGNAL_FUNC using the gpointer?

Chris

-- 
====================================================================
Ch. B. Westermann

University of Bern         
Physikalisches Institut      
Sidlerstrasse 5            phone: +41(0)31 6314417
3012 Bern                    fax: +41(0)31 6314405
Switzerland                email: christian.westermann@phim.unibe.ch
 			   http://phimcasymir.unibe.ch/casymir/cas_SS.html



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