[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: get text from GtkText
- From: ZB <zb197 yahoo com>
- To: gtk-app-devel-list gnome org
- Subject: Re: get text from GtkText
- Date: Tue, 28 Aug 2001 08:15:16 -0700 (PDT)
dont use the old one.
read the api at:
http://developer.gnome.org/doc/API/gtk/gtkeditable.html#GTK-EDITABLE-GET-CHARS
you want to use "gtk_editable_get_chars"
Syntax is
gchar *tmp;
tmp = gtk_editable_get_chars (GTK_EDITABLE(WIDGET), 0,
-1)
printf ("This is my text %s\n", tmp);
g_free(tmp);
WIDGET is the widget you created.
Zev.
--- Maciej Hrebien <m_hrebien@wp.pl> wrote:
> 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
>
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]