Re: keep scrollbar knob at bottom?
Re: keep scrollbar knob at bottom?
- Subject: Re: keep scrollbar knob at bottom?
- From: Roarke Lynch <email@hidden>
- Date: Tue, 31 Dec 2002 11:58:06 -0500
You are right about NSScrollview being the container for your
NSTextView. But you should not have to make a connectiong to the
scrollbars themselves to scroll the view.
If you use insertText instead of setString, your NSTextView will
automatically scroll to the insertion point. In your case, end of the
text.
On Tuesday, December 31, 2002, at 02:51 AM, Eric Blom wrote:
>
I'm working on my first GUI application and it is for the Mac! I hope
>
that someone here can help me out with this question. Please feel
>
welcome to pass along any advice suitable for a beginner.
>
>
My app has a log window. Messages are appended to the window so I
>
would like the scrollbar knob to stay positioned at the bottom of the
>
vertical scrollbar, just like it does in the terminal.app. I have
>
almost been able to get the desired behavior by using the setPoint
>
method, but, it seems like a hack because my NSPoint value is
>
arbitrary and the knob stays just a line or two above the bottom most
>
of the time.
>
>
From what I can see in Interface Builder the view I have has two
>
outlets. One I have connected to logWindow the other I haven't figured
>
out what to do with yet, but, it seems to be of the type NSScrollView.
>
Is NSScrollView the container and NSTextView a component of the
>
container? If so should I be able to make a connection to the
>
scrollbar components of the container?
>
>
I have been searching though the one book I have, Cocoa Programming by
>
Scott Anguish, and the documentation on NSScrollView, NSView,
>
NSScroller, and NSTextView, but, I have not found the answer.
>
>
I believe the following lines of codes are relevant to my question and
>
my clarify my intent.
>
>
IBOutlet NSTextView *logWindow;
>
NSString *message;
>
NSPoint myPoint;
>
myPoint.x = 0;
>
myPoint.y = 200000;
>
[logWindow setString: [[logWindow string]
>
stringByAppendingString:message]];
>
[logWindow scrollPoint:myPoint];
>
>
Cheers,
>
Eric
>
>
-----------------------------------------------------------------
>
Eric D. Blom
>
email@hidden
Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
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.