Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Collapse NSSplitView pane programatically



> I really wonder if what I'm attempting to do is even
> possible without subclassing

It possible via subclassing but an easier solution is to implement the
delegate function:

splitView:resizeSubviewsWithOldSize:

This gives you the chance to determine the size of the view on resize.


You can also do it via the containing window delegate, but the former is
clearer when it comes to maintaining the code.

- (void)windowDidResize:(NSNotification *)aNotification

Main window's delegate and check the splitView.  If it's 1 or 2 pixels big
then it's been creeping out, just set it back to 0 as the window resizes.


Here is the answer to your question in the documentation:

file:///Developer/ADC%20Reference%20Library/documentation/Cocoa/Conceptual/D
rawViews/Concepts/AboutSplitViews.html

" When the NSSplitView is displayed‹whether it¹s being displayed for the
first time or redisplayed because the user resized the NSSplitView¹s
window‹it checks to see if its subviews are properly tiled. If not, it
invokes the delegate method splitView:resizeSubviewsWithOldSize:, allowing
the delegate to specify the heights (or widths) of specific subviews. If the
delegate doesn¹t implement this method, the NSSplitView sends adjustSubviews
to itself to resize the subviews proportionately. Note that the NSSplitView
doesn¹t call the delegate methods
splitView:constrainMaxCoordinate:ofSubviewAt:,
splitView:constrainMinCoordinate:ofSubviewAt:, or
splitView:constrainSplitPosition:ofSubviewAt: and may resize its subviews in
a way that isn¹t allowed by these delegate methods."

Regards,

Conor Dearden
www.bruji.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.