Re: GtkTextBuffer: Q: offsets to indicies?



On Wed, 2002-08-07 at 23:20, Olivier wrote:
it is indeed a bit faster, but still with this function my highlighting
engine is spending 30% of it's time to convert byte offsets to UTF8
offsets. 

Why is there no simple way to set a GtkTextIter to a byteoffset in the
text? It can be done per line (the function gtk_text_iter_set_line_index()
does exist!?) so why no gtk_text_iter_set_index() function?


I've been asking myself that question over and over. It is rather
strange IMHO. But the cache trick made me colorize a 2.5 mb (65000+
lines) in just less than 2 seconds. That is not bad considering that you
would only color the whole file once (when it is loaded) and then just
color the visible part which won't be many lines. 
Even to make the user-interface more responsive you could queue coloring
tasks in a separate thread ?

Regards,
Janus

-- 
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





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