Re: gtk_entry_get_text



void
on_entry_insert_text (GtkEditable *editable,
                                gchar          *new_text,
                                gint              new_text_length,
                                gpointer        position,
                                gpointer        user_data)
{
  const gchar *str;
  str = gtk_entry_get_text (GTK_ENTRY (new_text));
new_text is a char pointer not a Widget. hence the segfault.

Looks like you have a GtkEditable widget and not a GtkEntry widget.
So the api to get the inserted text would be
void gtk_editable_get_chars (GtkEditable *editable, gint start, gint
end);

look here:
http://developer.gnome.org/doc/API/gtk/gtkeditable.html#GTK-EDITABLE-GET-CHARS
for more details.

Regards,
Raj



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