Getting checkbutton's label



Hi all,
      I have a series of checkbuttons on my application but I have not
      found a way of properly/easily identifying them at run time. Yes,
      sure I can associate a callback to each of them but that seems
      wasteful. So:

      	[x] checkbutton-1
	[ ] checkbutton-2
	    :
	[x] checkbutton-n

     I think I can use a plain value in the signal connect function as the
     user data but I am not quite sure if it is 'legal' as signal_connect
     expects a pointer for its last parameter (user data). Perhaps by
     something like gtk_checkbutton_get_label() (well, this 'method' would
     be ok at least for debugging).

     Most of my checkbuttons do not have a style 'name' associated with
     them so the name member is 'nil'. So far I use a weird construct of
     passing a structure as user data and in that structure I have other
     information, but in the 'extension' I chain the gtk callback with a
     user callback (ugh! I have my reasons). But then there the user callback
     has to compare the widget pointer with that contained in a global
     composite variable (struct) that contains other info. Any ideas for
     a better implementation?

     		
-- 
D. Emilio Grimaldo Tunon       Compuware Europe B.V. (Uniface Lab)
Software Engineer	       Amsterdam, The Netherlands
emilio_tunon@nl.compuware.com  Tel. +31 (0)20 3116 200 ext. 413



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