[Glade-users] Re: gtk_entry_get_text(gaof)

gaof gaof@guoguang.com.cn
Sat, 15 Jan 2005 10:47:32 +0800


1. The "new_text" is not a widget. If you want to get the text in=
 the entry, you should
do like this:
            str =3D gtk_entry_get_text (GTK_ENTRY (editable));

2. If you want only the new text, just the "new_text".
>--__--__--
>
>Message: 1
>Date: Thu, 13 Jan 2005 19:46:57 -0800 (PST)
>From: Aaron Yang <porsche1904@yahoo.com>
>To: gtk-app-devel-list@gnome.org, glade-users@lists.ximian.com,
>=09gtk-list@gnome.org
>Subject: [Glade-users] gtk_entry_get_text
>
>--0-1537386309-1105674417=3D:2665
>Content-Type: text/plain; charset=3Dus-ascii
>
>hi everyone,
> 
>  I've created an entry box and when i type something in the=
 box, I would like to get the information and display it.
>  Like the following using glade:
> 
>void
>on_entry_insert_text (GtkEditable *editable,
>                                gchar          *new_text,
>                                gint             =
 new_text_length,
>                                gpointer        position,
>                                gpointer        user_data)
>{
>  const gchar *str;
>  str =3D gtk_entry_get_text (GTK_ENTRY (new_text));
> 
>  printf("data entered =3D s\n", str);
>  return;
>}
> 
>error message:
>segmentation fault
> 
>anyone knows how to solve?
> 
>regards
>
>=09=09
>---------------------------------
=09=09=09=09 
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1gaof
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1gaof@guoguang.com.cn
=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12005-01-15