• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Collapse NSSplitView pane programatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Collapse NSSplitView pane programatically
      • From: Dustin Wenz <email@hidden>
  • Prev by Date: Re: Collapse NSSplitView pane programatically
  • Next by Date: Re: I think I have found a big bug in NSBrowser
  • Previous by thread: Re: Collapse NSSplitView pane programatically
  • Next by thread: Re: Collapse NSSplitView pane programatically
  • Index(es):
    • Date
    • Thread