[Glade-users] Help passing more than one variable as argument to a function



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?

that's how my code looks like:

code on interface.c:

GtkWidget *entry1;
  GtkWidget *entry2;
  GtkWidget *entry3;
  GtkWidget *entry4;
  GtkWidget *entry5;
   GtkWidget *campos[5];
 campos[0]=entry1;
  campos[1]=entry2;
  campos[2]=entry3;
  campos[3]=entry4;
  campos[4]=entry5;
 gtk_signal_connect(GTK_OBJECT(clean),"clicked",GTK_SIGNAL_FUNC(on_limpar_activate),campos);



callback function on callbacks.c:

void
on_limpar_activate                       (GtkMenuItem     *menuitem,
                                          gpointer   user_data)
{
int i;
for(i=0;i<5;i++) gtk_entry_set_text(user_data+i,"");
}


Daniel Macedo
damacedo task com br






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]