Re: passing 3 widgets as parameters to g_signal_connect



Hi Andrei,

Thanks for the answer, but it only changes the error.

Now I get:

warning: assignment discards qualifiers from pointer target type

Ah, BTW I'm using 

gcc -o calc main.c `pkg-config --cflags --libs gtk+-2.0`
main.c: In function `on_vezes_clicked':
main.c:217: warning: assignment discards qualifiers from pointer target type
main.c:218: warning: assignment discards qualifiers from pointer target type


---------------------
void
on_vezes_clicked                       (GtkButton       *button,
                                        gpointer         user_data)
{

  CALC *elem;
  (CALC *) elem = user_data;

  oper1 = gtk_entry_get_text(GTK_ENTRY(elem->op1));
  oper2 = gtk_entry_get_text(GTK_ENTRY(elem->op2));
  ...
  ires = iope1 * iope2;
  sprintf(result,"%4d", ires);
 /* Here I get A Segfault  :( */  
gtk_entry_set_text(GTK_ENTRY(elem->res), result);

}
--------------------------------


>) oper1 = gtk_wentry_get_text (GTK_ENTRY (elem->op1));
>) oper2 = gtk_wentry_get_text (GTK_ENTRY (elem->op2));


Cheers,

LEslie

-- 
Outside of a dog, a book is a man's best friend.
Inside a dog it's too dark to read.
Groucho Marx



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