• 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
NSScrollView and Custom Views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScrollView and Custom Views


  • Subject: NSScrollView and Custom Views
  • From: email@hidden
  • Date: Sun, 26 Jun 2005 23:50:32 -0400

I am working with an NSScrollView and a custom NSView (which right now is just a simple rectangle with a background color). In my diagrams below, the scroll view ("-") encloses the custom view ("+").

What I want:

------------------------
-                      -
-      +++++++++       -
-      +       +       -
-      +       +       -
-      +       +       -
-      +++++++++       -
-                      -
------------------------

What I have:

------------------------
-                      -
-                      -
-                      -
+++++++++              -
+       +              -
+       +              -
+       +              -
+++++++++---------------

Right now, the custom view is set with the Autoresizing mask of NSViewNotSizable (which was the only way I could get it to be scrolled by the NSScrollView). It seems to be anchored, however, to the lower lefthand corner of my NSScrollView. I've tried using setBoundsOrigin: and setFrameOrigin: and a multitude of other things (in drawRect:, etc.) to try to get the custom view to be painted in the middle of the NSClipView (I've written code that accurately calculates where that is). However, I can't get it to budge! I think I might be having a problem with the different "coordinate systems" of the views and was hoping someone here might be able to give me some direction.

Anyone have any ideas?  Am I way off course?

Thanks!

Cameron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSScrollView and Custom Views
      • From: Joshua Scott Emmons <email@hidden>
  • Prev by Date: Re: Class clusters - infinite loop?
  • Next by Date: Re: Calling -retain inside -dealloc
  • Previous by thread: Re: Calling -retain inside -dealloc
  • Next by thread: Re: NSScrollView and Custom Views
  • Index(es):
    • Date
    • Thread