Re: Parameter passing advice...
- From: Clemens Kirchgatterer <clemens root at>
- To: Chris Elston <celston corky sapien net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Parameter passing advice...
- Date: Tue, 25 Sep 2001 20:49:17 +0200
Chris Elston wrote:
A common "problem" when working the C version of GTK is the what's and
how's of passing parameters to signal handling functions. If I'm not mistaken,
every "signal_connect" function ends in a gpointer (* void) parameter
which is there for the programmer to use for his own purpose(s). Now,
I have experience with C but I'm no expert so this next question is both
related to that and my curiousity with GTK.
Sometimes, one parameter is not enough. What methods have you all used in
the past to get around having only one gpointer at your disposal when you
need much more? GLists? Arrays? some kind of hack around with regards
to the nature of void pointers?
if you need a relativly low and fixed number if parameters, a pointer to
a struct will do the job. when the numbers of parameters is fixed but
big, i would use a pointer to an array of pointers, otherwise a glist.
] [Thread Prev