[Glade-users] gtk_entry_get_text

Aaron Yang porsche1904@yahoo.com
Thu, 13 Jan 2005 19:46:57 -0800 (PST)


--0-1537386309-1105674417=:2665
Content-Type: text/plain; charset=us-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 = gtk_entry_get_text (GTK_ENTRY (new_text));
 
  printf("data entered = %s\n", str);
  return;
}
 
error message:
segmentation fault
 
anyone knows how to solve?
 
regards

		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Easier than ever with enhanced search. Learn more.
--0-1537386309-1105674417=:2665
Content-Type: text/html; charset=us-ascii

<DIV>hi everyone,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; I've created an entry box and when i type something in the box, I would like to get the information and display it.</DIV>
<DIV>&nbsp; Like the following using glade:</DIV>
<DIV>&nbsp;</DIV>
<DIV>void</DIV>
<DIV>on_entry_insert_text (GtkEditable *editable,</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gchar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *new_text,</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new_text_length,</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gpointer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; position,</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gpointer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_data)</DIV>
<DIV>{</DIV>
<DIV>&nbsp; const gchar *str;</DIV>
<DIV>&nbsp; str = gtk_entry_get_text (GTK_ENTRY (new_text));</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; printf("data entered = %s\n", str);</DIV>
<DIV>&nbsp; return;</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>error message:</DIV>
<DIV>segmentation fault</DIV>
<DIV>&nbsp;</DIV>
<DIV>anyone knows how to solve?</DIV>
<DIV>&nbsp;</DIV>
<DIV>regards</DIV><p>
		<hr size=1>Do you Yahoo!?<br> 
Yahoo! Mail - Easier than ever with enhanced search. <a href="http://us.rd.yahoo.com/evt=29916/*http://info.mail.yahoo.com/mail_250">Learn more.</a>
--0-1537386309-1105674417=:2665--