keep scrollbar knob at bottom?
keep scrollbar knob at bottom?
- Subject: keep scrollbar knob at bottom?
- From: Eric Blom <email@hidden>
- Date: Mon, 30 Dec 2002 23:51:59 -0800
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
Be at war with your vices, at peace with your neighbors, and let
every New Year find you a better man. --Benjamin Franklin
-----------------------------------------------------------------
_______________________________________________
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.