Page-by-page scrolling in an NSTextView with fixed-pitch font
Page-by-page scrolling in an NSTextView with fixed-pitch font
- Subject: Page-by-page scrolling in an NSTextView with fixed-pitch font
- From: Marten van Gelderen <email@hidden>
- Date: Tue, 6 Jan 2004 21:50:31 +0100
Dear List,
My app displays UNIX ASCII output (via NSTask and NSPipe) in an
NSTextView embedded in an NSWindow. Using -windowWillResize:toSize: I
was able to constrain the resizing of the window to line-by-line in the
vertical sense and char-by-char in the horizontal sense, just as
Terminal.app does it. This works irrespective of the font-size, as long
as a fixed-pitch font is used in the view.
My UNIX ASCII output is pre-formatted according to the width and height
of the view. Using -setVerticalLineScroll: and -setVerticalPageScroll:
in the enclosing NSScrollView of my NSTextView I was able to constrain
scrolling of my (pre-formatted) output to line-by-line (by clicking in
the arrows) and page-by-page (by clicking outside the scroll button or
ALT-clicking in the arrows). Works nice, looks good.
Now I would like to constrain dragging the scroll button to display my
output in page-by-page increments (just as resizing my window gives
line-by-line and char-by-char increments).
Is there an equivalent to: -windowWillResize:toSize; when dragging the
scroll button? Which message is fired when the scroll button is
dragged? I found NSViewBoundsDidChangeNotification, but I am not quite
sure, so far, if this is the proper way to go.
Any help is greatly appreciated.
--
Groeten, Marten
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.