Give like this:
-----------
printf((example*)data->age);
-------------
On Wednesday 01 April 2009, Saju M wrote:
> How solve this .
>
> error: request for member ‘age’ in something not a structure or union
>
>
>
>
> [s...@localhost src]$ make
> gcc -DHAVE_CONFIG_H -I. -I.. -DPACKAGE_DATA_DIR=\""/usr/local/share"\"
> -DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\" -I/usr/include/gtk-2.0
> -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo
> -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
> -I/usr/include/freetype2 -g -O2 -MT interface.o -MD -MP -MF
> .deps/interface.Tpo -c -o interface.o interface.c
> interface.c: In function ‘on_b_send_pressed’:
> interface.c:140: error: request for member ‘age’ in something not a
> structure or union
> make: *** [interface.o] Error 1
> [s...@localhost src]$
>
>
>
>
>
>
>
>
>
> /*
> * DO NOT EDIT THIS FILE - it is generated by Glade.
> */
>
> #ifdef HAVE_CONFIG_H
> # include <config.h>
> #endif
>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <unistd.h>
> #include <string.h>
> #include <stdio.h>
>
> #include <gdk/gdkkeysyms.h>
> #include <gtk/gtk.h>
>
> #include "callbacks.h"
> #include "interface.h"
> #include "support.h"
>
>
>
> #define GLADE_HOOKUP_OBJECT(component,widget,name) \
> g_object_set_data_full (G_OBJECT (component), name, \
> gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
>
> #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
> g_object_set_data (G_OBJECT (component), name, widget)
>
>
>
> typedef struct{
>
> int age;
> GtkWidget *t_entry1;
>
> }example;
>
>
> void
> on_b_send_pressed(GtkButton *button,gpointer data);
>
>
>
> GtkWidget*
> create_window1 (void)
> {
> GtkWidget *window1;
> GtkWidget *hbox1;
> // GtkWidget *t_entry1;
> GtkWidget *b_send;
> GtkWidget *t_entry2;
>
>
> example ex1;
>
> gchar *phone ="saju";
>
> ex1.age=55;
>
> window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title (GTK_WINDOW (window1), _("window1"));
>
> hbox1 = gtk_hbox_new (FALSE, 0);
> gtk_widget_show (hbox1);
> gtk_container_add (GTK_CONTAINER (window1),hbox1);
>
> ex1.t_entry1 = gtk_entry_new ();
> gtk_widget_show (ex1.t_entry1);
> gtk_box_pack_start (GTK_BOX (hbox1),ex1.t_entry1, TRUE, TRUE, 0);
> gtk_entry_set_invisible_char (GTK_ENTRY(ex1.t_entry1), 8226);
>
> b_send = gtk_button_new_with_mnemonic (_("Send"));
> gtk_widget_show (b_send);
> gtk_box_pack_start (GTK_BOX (hbox1), b_send, FALSE, FALSE, 0);
>
> t_entry2 = gtk_entry_new ();
> gtk_widget_show (t_entry2);
> gtk_box_pack_start (GTK_BOX (hbox1),t_entry2, TRUE, TRUE, 0);
> gtk_entry_set_invisible_char (GTK_ENTRY (t_entry2), 8226);
>
> g_signal_connect ((gpointer)b_send, "pressed",
> G_CALLBACK (on_b_send_pressed),
> &ex1);
>
> return window1;
> }
>
>
>
> void on_b_send_pressed(GtkButton *button,gpointer data)
> {
>
>
> printf((example*)data.age);
>
>
> //gtk_entry_set_text(GTK_ENTRY(data),"ok");
>
> //gtk_entry_set_text(GTK_ENTRY((example*)*data->t_entry1),"ok");
>
> //g_print(("ok");
>
>
> }
>
_______________________________________________
Mailinglist mailing list
[email protected]
http://ilug-cochin.org/mailman/listinfo/mailinglist_ilug-cochin.org