Re: Collapse NSSplitView pane programatically
Re: Collapse NSSplitView pane programatically
- Subject: Re: Collapse NSSplitView pane programatically
- From: Conor Dearden <email@hidden>
- Date: Tue, 31 Jan 2006 11:59:18 +0100
> 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 Reference Library/documentation/Cocoa/Conceptual/D
rawViews/Concepts/AboutSplitViews.html
" When the NSSplitView is displayedwhether it¹s being displayed for the
first time or redisplayed because the user resized the NSSplitView¹s
windowit 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:
This email sent to email@hidden