Re: Collapse NSSplitView pane programatically
Re: Collapse NSSplitView pane programatically
- Subject: Re: Collapse NSSplitView pane programatically
- From: Dustin Wenz <email@hidden>
- Date: Tue, 31 Jan 2006 11:43:05 -0600
Well, I was able to do it by setting a "manual resize" flag in
splitViewWillResizeSubviews, which allows me to distinguish between
resizing by dragging a divider, or if the panes are shaped by
resizing the superview (the parent window). In
resizeSubviewsWithOldSize, I can then preserve the state of my
collapsed panes before invoking adjustSubviews, and restoring their
state afterwards.
This is somewhat annoying to have to do, but it works great. Thanks
for your help!
- .Dustin
On Jan 31, 2006, at 4:59 AM, Conor Dearden wrote:
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 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:
40iscompanies.com
This email sent to email@hidden
_______________________________________________
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