Re: gtk_text_buffer_get_* should return length? (1.3.6)



Joshua N Pritikin <vishnu pobox com> writes:
The APIs in question are:

 gchar*      gtk_text_buffer_get_text        (GtkTextBuffer *buffer,
                                              const GtkTextIter *start,
                                              const GtkTextIter *end,
                                              gboolean include_hidden_chars);
 gchar*      gtk_text_buffer_get_slice       (GtkTextBuffer *buffer,
                                              const GtkTextIter *start,
                                              const GtkTextIter *end,
                                              gboolean include_hidden_chars);

Why don't these APIs return the length?  It seems dumb to do a strlen()
when _gtk_text_btree_get_text() actually had the data nicely wrapped
in a GString.

Shall i file this request in bugzilla?


I think it would make the API a bit less convenient for simple cases. 
Maybe add gtk_text_buffer_get_text_with_len? That seems a bit
API-bloatish to me though, so I'm not sure about it.

Of course, we already have the bizarre duplication of API between the
iter and the buffer for getting text, so maybe if we fix that we have
a couple functions saved and can spend them elsewhere. ;-)

Maybe file a bug so we at least think about it a bit more.

Havoc




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