[ILUG-Cochin.org] GTK Error
Saju M
sajuptpm at gmail.com
Wed Apr 1 18:59:41 IST 2009
How solve this .
error: request for member ‘age’ in something not a structure or union
[saju at 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
[saju at 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");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ilug-cochin.org/pipermail/mailinglist_ilug-cochin.org/attachments/20090401/26dff4d8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface.c
Type: text/x-csrc
Size: 2093 bytes
Desc: not available
URL: <http://ilug-cochin.org/pipermail/mailinglist_ilug-cochin.org/attachments/20090401/26dff4d8/attachment.bin>
More information about the Mailinglist
mailing list