• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
keep scrollbar knob at bottom?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: keep scrollbar knob at bottom?
      • From: Roarke Lynch <email@hidden>
    • Re: keep scrollbar knob at bottom?
      • From: Stephan Burlot <email@hidden>
  • Prev by Date: Re: Symbol conflict?
  • Next by Date: Re: CF Portability
  • Previous by thread: Re: button title and modifier keys
  • Next by thread: Re: keep scrollbar knob at bottom?
  • Index(es):
    • Date
    • Thread