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 > Need Cocoa Help - NSView, NSScrollView, NSClipView

Need Cocoa Help - NSView, NSScrollView, NSClipView
Thread Tools
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Sep 23, 2005, 07:50 AM
 
I need some help coding to views in Cocoa/Obj-C, specifically, NSView, NSScrollView & NSClipView.

What I want to do is be able to programmatically scroll an NSView inside an NSScrollView. What I've done is create my NSView, and placed that in an NSSCrollView. I did all this in Interface Builder.

Now if I allow the scrollbars to be visible I can scroll my NSView around so I know this part is working. What I want to do is keep the bars invisible and scroll the view in code using the scrollToPoint: method. My problem is how do I do this in code?

I've tried using the scrollToPoint: method in my NSScrollView's drawRect method but that didn't work. Do I need to make a controller class, then assign outlets to my views?

Do I need to explicitly define an NSClipView to do this?
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Sep 23, 2005, 10:20 PM
 
Well, the solution to my problem was stupidly simple. Nothing to see here, move along.
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
   
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 07:37 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