Re: get text from GtkText



Thomas Mailund wrote:

On Tue, 2001-08-28 at 21:48, guigtk wrote:
Is there any way to get the text that i wrote in a GtkText?


With the (old) text widget you can use

gchar*     gtk_editable_get_chars      (GtkEditable      *editable,
                                        gint              start_pos,
                                        gint              end_pos);

so to get all the text in 'text' you use

gchar *my_text = gtk_editable_get_chars (GTK_EDITABLE (text), 0, -1);

What about memory? Does GTK allocates (new) memory for this chars
pointed by my_text? From the other hand: do I have to free memory
pointed by my_text after using it??

-- 
Maciej Hrebien





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