On 10-09-10 23:51, Lance Dillon wrote:
I see what you are talking about here. That is something different. That is for when you build a c, c++, or ada project by going to Project->Build. It outputs a bunch of files. In the src directory there is a file called interface.c that has the code for connecting the signal. If you look in interface.c, you will see this in there somewhere:
Isn't the pike module all about generating the code. And as such shouldn't it try to implement the same?
I have no idea how hard it is, but isn't it just adding this data to the "mixed data" which is called together with signal_auttoconnect for each handler?
Since the code is a little different, what I would do would be to create a mapping with a bunch of data to be used by multiple callbacks. Then you can say match the object with a key in the mapping for data to pass to the signal.
The goal is not to have data at hand, the goal was to differentiate between the objects sending the signal.
Maybe I'm doing something very uncommon in interface design? I have i.e. two buttons, which have the same signal handler, and in the signal handler I want to do two different things based on which of the two buttons is pressed.
What is normally done here? Do you use different signal handlers for each button, or is there a different way to determine which button is pressed? And what if the buttons are dynamically created, maybe even with the same name?
(mind I'm very new to GTK altogether).
I should add set_data() and get_data() to gobject (in the inheritance tree of all the widgets) so we could attach arbitrary data to gtk2 objects. It could be used to get around this problem.
This would work I think. Then I could add a variable to the button object.