docs:programming:cocoa_and_objective-c:nsscrollview

NSScrollView

Primarily this is used by me to load an image file into a custom view in a particular window. The relationship/order of objects is:

  1. NSWindow
  2. NSScrollView
  3. NSClipView
  4. NSView (where the NSImageRep is drawn)
  • for illustration purposes, a custom view will be added to a window in IB
  • NSView will be subclassed to MyView, and the custom view will use the custom class, MyView
  • with MyView selected in IB, Layout → Make subviews of → Scroll View
  • MyView is now the documentView of NSClipView and NSScrollView
  • NSClipView is the contentView of NSScrollView
  • to manually scroll, modify the bounds origin of the NSClipView
  • docs/programming/cocoa_and_objective-c/nsscrollview.txt
  • Last modified: 2008/08/03 00:25
  • by 127.0.0.1