Skip navigation.
 
mlNSDocument and control of multiple views
FROM : Steve Weller
DATE : Mon Mar 03 05:15:26 2008

I have a document-based application that has a custom view that fills 
much of the content view. In that custom view I want to display a 
"page" like a piece of paper. As the window is scaled, the "page" 
scales. This all works either if I code the page as a part of the 
custom view, or if I set it up as another custom view which is a 
subview of the larger view.

But which is the better approach? I will want to work at two scales at 
all times: the scale on the page and the scale on the custom view. 
Will a subview make that easier?

If I do use a subview, then what should my philosophy be for 
communicating among objects? I *think* that the NSDocument should 
manage both views. If the user resizes the window, that will resize 
the frame of the custom view. That will send a notification to the 
NSDocument which will make the appropriate changes to both views 
(scaling, bounds, whatever). Or is there a better way?

Related mailsAuthorDate
No related mails found.