RE: Is it possible to share a callback function in order to detect which a button is clicked?

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

 



I have got the solution from yours, g_object_set_data().

I appreciate for your help.

Regards,
bkna

>> -----Original Message-----
>> From: gtk-list-bounces@xxxxxxxxx [mailto:gtk-list-bounces@xxxxxxxxx] On
>> Behalf Of David Ne?as
>> Sent: Friday, February 05, 2010 8:46 PM
>> To: Ken Resander
>> Cc: gtk-list@xxxxxxxxx
>> Subject: Re: Is it possible to share a callback function in order to
>> detect which a button is clicked?
>> 
>> On Fri, Feb 05, 2010 at 03:34:08AM -0800, Ken Resander wrote:
>> > I cannot see the dm userdata parameter being initialised.
>> >
>> > Insert dm->clicked = num; before g_signal_connect in the double-
>> nested  loop.
>> > Then you can test on dm->clicked in the callback to check which
>> > button is clicked.
>> 
>> There is only one instance of dm in the entire program so this won't
>> work, you will always get whatever was last assigned to dm->clicked.
>> 
>> To make it work you need one dm (or whatever kind of data) per widget.
>> g_object_set_data() is the mechanism to attach arbitrary data to
>> objects.
>> 
>> Yeti
>> 
>> _______________________________________________
>> gtk-list mailing list
>> gtk-list@xxxxxxxxx
>> http://mail.gnome.org/mailman/listinfo/gtk-list



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

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux