Re: passing 3 widgets as parameters to g_signal_connect
- From: Russell Shaw <rjshaw netspace net au>
- Cc: gtk-list gnome org
- Subject: Re: passing 3 widgets as parameters to g_signal_connect
- Date: Tue, 06 Jul 2004 01:19:41 +1000
Leslie Harlley Watter wrote:
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;
elem=(CALC*)user_data;
G_CONST_RETURN gchar *oper1,*oper2;
oper1 = gtk_entry_get_text(GTK_ENTRY(elem->op1));
oper2 = gtk_entry_get_text(GTK_ENTRY(elem->op2));
...
ires = iope1 * iope2;
gchar result[80];
sprintf(result,"%4d", ires);
g_snprintf(result,80,"%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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]