[gedit-list] Plugins: How to get the boundaries of a view within a buffer?



Note: I sent this mail yesterday but it's queued for moderator
approval. I just subscribed to the list so I am sending it again.

Hello,

I am trying to write a plugin with an idea I came up with. No need to
bore you with the details, but it's a thumbnailed view of the entire
file that gets displayed next to the TextView. I'll post it here if I
can get the thing working.

What I can't figure out is how to know which lines of the buffer are
being displayed in a view, or how to get a GtkTextIter pointing to the
boundaries of the view. Something like GtkTextBuffer.get_bounds() but
for a view instead of a buffer. Is there such a thing in
GtkSourceView? I haven't been able to find anything on the web. For
example:

Line1
Line2
---------- view begins here
Line3
Line4
---------- view ends here
Line5

I need to get the line numbers for the beginning and end of the view,
and if possible keep this information updated when scrolling or
insertion/deletion occurs. I can bind to the corresponding signals for
this, I guess.

Links or hack suggestions to obtain these numbers are very much welcome.

Thanks!

Gonzalo


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