Prabhu Gnana Sundar <prabh...@...> writes:
> I have been working on a project to develop a test bed. I am
> creating a GUI using Gtk programming. Here now I am required
> to read inputs from multiple Gtk Entries and process them on
> a click of a Gtk Button. But I am unable to find how to send
> multiple gpointers through g_signal_connect. Please guide me.
One approach is to keep the pointers to the entry widgets global. But
keeping them global is a bad idea, makes the code hard to read and
maintain.
The other solution is to create a structure for your application, that
keeps track of application state including the pointers to the entry
widgets.
struct AppState {
GtkWidget *entry1;
GtkWidget *entry2;
GtkWidget *entry3;
... other application state ...
};
1. Create an instance of the state structure in main()
2. Update the state structure when the widgets are created.
3. Pass its pointer to all g_signal_connect() invocations.
HTH.
Regards,
Vijay
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc