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

Re: g_signal_connect() and passing multiple arguments



--- Adrian Immler <a.immler@12mm.de> wrote:
> hello,
> 
> i'm a c/c++ AND gtk newbie and i have a question to
> you geeks:
> 
> how can i pass more than one argument/variable to a
> function like this with g_signal_connect() ?
> 
> gint function_test( gpointer emitter, gpointer
> liste, gpointer entry, gpointer something else ){
>   // do something
> }


declare a structure to hold all the data and pointers
you require.

define a variable for it.  Allocate memory for that
var through g_malloc.

fill the data i.e. populate it and send the address of
this structure to the signal_connect function

in the callback again typecast the received pointer to
your structure and use it

;-)

Tushar

=====
Full Name     : Tushar Vijay Joshi
Address       : 42/3  Ujjwal Nagar,  Wardha Road,  Nagpur  440 025
Contant Nos : (0) 91-712-2235940 (R) 91-712-2260565 (M) 98222-20365
Email           : tusharvjoshi@yahoo.com               YahooID: tusharvjoshi
Linux User# :  252476  Machine #: 187438, 187439
Use Linux.  Get Counted @ http://counter.li.org

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



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