Re: Problem with gtk_text_view_get_iter_location()?



On Thu, 2005-02-10 at 13:20 -0500, Kent wrote:
> Hello,
> 
> I'm having problems with gtk_text_view_get_iter_location(). I don't 
> know if I'm doing something wrong or the call is broken. I've attached 
> a sample test program which demonstrates the problem I'm having.
> When you run the program you will see that the 'y' coordinate is wrong.
> I have another production program in which both the x and y coordinates
> are wildy incorrect. What am I doing wrong? Is there some caveat that
> comes with gtk_text_view_get_iter_location() that I'm not aware of?
> 

There are a couple surprising things, one is mentioned here:
http://developer.gimp.org/api/2.0/gtk/GtkTextView.html#gtk-text-view-
get-iter-location

buffer coords vs. various other coordinate origins you might be
expecting.

Another is that the text view gets laid out asynchronously, so the
coords of a given iter will change as this happens. Right after you
insert a line it's normally 0-height for example.

Could also be a bug, especially since you're using 2.0 which was the
first appearance of TextView and is pretty old by now.

Havoc





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