Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSScrollView & Scrollbar

NSScrollView & Scrollbar
Thread Tools
Senior User
Join Date: Aug 2002
Location: Oxford, England
Status: Offline
Reply With Quote
Nov 10, 2002, 08:42 AM
 
Hi everyone,

I've got a view nested inside an NSScrollView but the scroll bar is always at the bottom when I run the program.

I've tryed returning 'YES' to -isFlipped on the view nested in the scrollview and that does make the scrollbar start at the top but it also flips the arrangement of anything inside the view.


Any ideas? Thanks!
Luke
     
sandsl  (op)
Senior User
Join Date: Aug 2002
Location: Oxford, England
Status: Offline
Reply With Quote
Nov 11, 2002, 07:43 AM
 
Anybody?
Luke
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Nov 11, 2002, 08:28 AM
 
Just a guess, but have you looked at setContentView?

There must be a method where you can manually set which part of the view you want to show.
     
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Nov 11, 2002, 01:35 PM
 
As far as I know, there's no built-in support for what you're trying to do. But you can probably do it anyway.

Use a subclass of NSScrollView and override the 'tile' method. This method is what lays out the NSScrollView's elements.

You should call super's implementation, then move the bottom NSScroller to the top (using something like setFrameBounds). Make sure you move the contentView (documentView? - can't remember which - it's an NSClipView) down so it's not obscured by the NSScroller you just moved.

I've never tried this, so I could be just talking out of my ass
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Nov 11, 2002, 06:46 PM
 
I think sending this message to your vertical NSScroller:

setFloatValue:knobProportion:

with appropraite float value between 0 and 1 will do exactly what you want. I made this work sometime back, but I'm a little foggy on exactly what I did to make it work.

Matt
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:19 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2