views:

9

answers:

0

Hello! I'm writing a document-based app. The main document view is a custom view (NSView subclass). This resides in a Scroll View and the accompanying ClipView, created through IB.

Scrolling works. The user can move objects around on the main view, and when they go off the edges the custom view adjusts it's frame-size and autoscrolls to keep the objects visible. Scrollers appear, as they should, when the document is larger than the window.

However, I run into trouble when opening saved documents that are larger than the window they're opened in. Scrollers don't appear; the scroll view doesn't seem to recognise that it's document view is larger. It doesn't take the hint to display scrollers until the window is resized. Then, it immediately displays scrollers appropriately.

However, not all users will load a document to immediately resize it. When they don't, the default view leaves out anything outside the scope of the window and doesn't provide scrollers to navigate with.

I have tried plenty of things.

  • It isn't enough to setFrameSize when the view awakeFromNibs.
  • I have posted notifications that the window resized without success.
  • I have to no avail used various "scrollToPoint" methods et.c. in the custom document view's awakeFromNib method.

I'm at a loss; the scrollers refuse to assist until resizing by dragging the window's corner.

Which resize action triggers the scrollers? How do I invoke this action upon opening a document that's too large to fit?