|
|
| Author |
Message |
|
|
aleph1trickpony
Joined: 05 May 2008 Posts: 3
|
Posted: Thu May 08, 2008 6:55 pm Post subject: using a struct as an argument to g_signal_connect |
|
|
| Is there a way to send a struct (in my case a collection of GtkWidgets) to the g_signal_connect function as user_data? I'm trying to write a callback whose actions depend on multiple widgets, which is why I need to do this. |
|
| Back to top |
|
 |
Micah Carrick Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 427 Location: Portland, OR USA
|
Posted: Thu May 08, 2008 7:45 pm Post subject: |
|
|
Why yes, that is the way we typically do it. You can use g_slice_new to allocate space for your struct.
Here is a small example which does just that. Check it out: http://www.gtkforums.com/about906.html |
|
| Back to top |
|
 |
aleph1trickpony
Joined: 05 May 2008 Posts: 3
|
Posted: Thu May 08, 2008 11:34 pm Post subject: |
|
|
| thanks! that works beautifully. |
|
| Back to top |
|
 |
|