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]

 



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


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

  Powered by Linux