[Glade-users] Help passing more than one variable as argument to a
function
Damon Chaplin
damon@helixcode.com
Thu, 14 Dec 2000 20:09:10 +0000
Daniel Macedo wrote:
>
> I am having problems passing more than oe argument through gpointer,
> using glade. I have a dialog box, with 5 entry texts, and i want to
> clear all of them. I am trying to use an array of widgets, but it doesn
> seem to work. how can i pass more than one variable, and connect this
> signal?
Glade provides a lookup_widget() function to get pointers to other widgets
in the window/dialog. So you could do this:
void
on_limpar_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *entry1, *entry2, *entry3;
entry1 = lookup_widget (GTK_WIDGET (menuitem), "entry1");
entry2 = lookup_widget (GTK_WIDGET (menuitem), "entry2");
entry3 = lookup_widget (GTK_WIDGET (menuitem), "entry3");
...
Damon