On Tue, Dec 25, 2012, at 12:14 PM, Gordon Apple wrote: > Thanks, Kyle. That almost worked correctly. Now the subclassed > popover > does change to the correct size. However, the view seems to float over > the > popover, and when changed, is offset about 20 pixels to the lower left of > the popover balloon. (I only update the content view¹s frameSize and > don¹t > touch the frameOrigin.) Time to update my bug report.
Thou shalt never change the frame of a window's (or popover's) content view. The correct way to resize a content view is by manipulating the frame of its container. This advice is generalizable to any view whose frame you do not directly control. For example, thou shalt not change the frame of an NSBox's content view. (The exception here is NSSplitView, which explicitly condones implementing the delegate to directly change the frame of its subviews in -splitView:resizeSubviewsWithOldSize:, as long as it adheres to certain rules.) > My contention is that the reference implies that NSPopover should handle > this automatically. However, on rereading, it appears that the statement > is > ambiguous. They may have meant that calling ³changeSize² animates it. There is no (public) method named -changeSize. Do you mean -setContentSize:? > I > had interpreted it to mean that any change in the content size would > cause > it to animate. Note that they said ³content size², NOT ³contentSize². I > guess the devil is in the details. As per above, this is not a reasonable interpretation of this sentence. But go ahead and file a doc bug asking them to be more specific, using `contentSize` instead of the prose "content size." > > ³Changes to the content size of the popover will cause the popover to > animate while it is shown if the animates property is YES.² > > I haven¹t found any solution to the popover -> window morph problem. From the documentation: "The exact animation used is not guaranteed." I believe the animation currently used is a cross-fade. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
