Re: GtkTextBuffer: Q: offsets to indicies?



  This is what you want:

gtk_text_buffer_get_iter_at_offset(GtkTextBuffer *buffer,
                                   GtkTextIter *iter,
                                   gint char_offset);

On Qui, 2002-08-01 at 10:39, Janus N. Tøndering wrote:
Dear Sirs,

I am working on an application that passes the content of a
GtkTextBuffer to a function as a gchar array (using
gtk_text_buffer_get_slice). The function then returns ranges in the
gchar array that need coloring.

My problem is the handling of multibyte characters. I need to be able to
somehow convert an integer offset in the GtkTextBuffer into a index
(somthing a. la. gtk_text_buffer_get_iter_from_index). But I cannot find
such a function?

Maybe this should be done otherwise then?

Regards,
Janus N. Tøndering


-- 
Janus Nørgaard Tøndering      
email: janus bananus dk, j nus person dk or u011014 daimi au dk

"Would you buy a car with the hood welded shut?"
-Phil Hughes, Linux Journal Magazine

-- 
Janus Nørgaard Tøndering      
email: j nus person dk or u011014 daimi au dk

"Would you buy a car with the hood welded shut?"
-Phil Hughes, Linux Journal Magazine


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
-- 
Gustavo João Alves Marques Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>



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