Skip navigation.
 
mlRe: How to toggle the subviews of a split view?
FROM : John Clayton
DATE : Sat Dec 14 22:23:10 2002

Jacob!  I get it!  I need to resize both frame views to equal the width
plus the divider THEN call adjust subviews.  I bet that does it.  Many
thanks.

-John

On Saturday, December 14, 2002, at 11:25 AM, Jacob Engstrand wrote:

>
> On lvrdag, dec 14, 2002, at 15:38 Europe/Stockholm, John Clayton wrote:
>
>

>> From what you're saying, I realize that adjustSubviews is doing some
>> proportional calculations that are overriding the width I have set
>> the subview's frame to.  But then you suggest

>>> to set the frame sizes _exactly_ right, so the hights of the frames
>>> and the divider together fill the entire height of the BSSplitView

>> and this is where I get a little fuzzy.  I know I can use the
>> NSSplitView delegate method splitView:resizeSubviewsWithOldSize: to
>> get at the frame sizes manually and block adjustSubviews from being
>> called.  Should I be doing all my own frame resizing and never call
>> -adjustSubviews?

>
>
> Hi,
>
> This is what I mean (assuming a horizontal divider):
>
> 1. Find a good and cozy place in your code where you are sure that the
> NSSplitView will not be resized by its parent view. (In my case, this
> is just before I display the window with the NSSplitView in it, after
> resizeing the window and its contents.)
>
> 2. Pick one of the two childviews. (In my case, I pick the top view.)
>
> 3. Set the frame of the top child view.
>
> 4. Now, take the hight of the NSSplitView, subtract the height of the
> top child view that you just set. Also subtract the height of the
> divider (call -dividerThickness).
>
> 5. Now you will have the height that's available for the bottom child
> view. Set its frame to that height.
>
> 6. Call -adjustSubviews to make the NSSplitView update the position of
> the divider. (Maybe you'll need to call [mySplitView -setNeedsDisplay:
> YES] too.) If the heights of top view + divider + bottom view ==
> height of NSSplitView, the top and bottom views should not change
> their sizes when you call -adjustSubviews.
>
> Now, As long as the hight of the NSSplitView stays the same, the child
> views will not change their sizes.
>
> Regarding your question on -splitView:resizeSubviewsWithOldSize:, I
> don't implement that in my app, so I can't describe the steps you need
> to take to make that work, but from the docs it seems pretty straight
> forward.
>
> Hope this helps!
> /jak
>
> _________________________________________________________
> Magician. Have rabbit. Will travel.
>
>
>

Regards,

John Clayton
<email_removed>
----------------------------------
How glorius it is to be an Exception, and how painful.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlHow to toggle the subviews of a split view? John Clayton Dec 13, 01:02
mlRe: How to toggle the subviews of a split view? Jacob Engstrand Dec 14, 02:31
mlRe: How to toggle the subviews of a split view? John C. Randolph Dec 14, 03:31
mlRe: How to toggle the subviews of a split view? Greg Titus Dec 14, 03:51
mlRe: How to toggle the subviews of a split view? John Clayton Dec 14, 15:38
mlRe: How to toggle the subviews of a split view? Jacob Engstrand Dec 14, 17:25
mlRe: How to toggle the subviews of a split view? John Clayton Dec 14, 22:23