Re: Retrieve chars of a GtkText widget




Joachim Backes <backes@rhrk.uni-kl.de> writes:

> How to retrieve the Text of a GtkText Widget? I found the macro GTK_TEXT_INDEX(t, index), but one
> problem arises: what happens if the given "index" is too large? Because I don't know the length
> of the Widget's contents, I have to loop with an increasing index. 
> Is there a correct method?

 - gtk_text_get_length() gives you the length.

An easy way to get the entire contents of the text widget, is

 gtk_editable_get_chars (GTK_EDITABLE (text), 0, -1);

Where -1 means "to the end".

Regards,
                                        Owen



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