[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    RE: Parameter passing advice...
From:       "Hugues Bernard" <hbernard () gynov ! org>
Date:       2001-09-26 16:42:05
[Download RAW message or body]

> 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?

in addition to structs or lists or inheritance, you may use
gtk_object_set_data
&
gtk_object_get_data

see the docs.

Hope it helps.

Hugues

___
hbernard@gynov.org
Parler de GTK+ en français ? http://www.gynov.org/gtk/gtkfrenchlist.php3


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic