Query about Textview and Scrolled Window



I'm developing an application which needs to display contents of a file
of text divided into pages (either by formfeeds or optionally by some
other delimiter). Note of course the pages aren't necessarily all the
same number of lines.

I am using GtkTextView witth a buffer and GtkScrolledWIndow

I need to be able to say "viewing page X - Y" of file "foo" and have
this updated if the window is resized and/or the scroll position
changed.

Am I right in thinking I connect the "value-changed" signal for the
vertical adjustment to note scroll position changes and the "changed"
signal to note resizes?

Can someone please advise me how I obtain the top and bottom line
numbers being displayed on screen (from which I can get the page
numbers).

I'd like to mark off the pages with a horizontal line also which I think
should be possible but will that make the calculation more complicated?

Thanks for any assistance you can give.


John Collins Xi Software Ltd www.xisl.com




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