Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > nssplitview in resizing window

nssplitview in resizing window
Thread Tools
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Nov 10, 2001, 06:13 AM
 
hi everybody,

ok, i got an nssplitview in a window that is resizeable. by making my app the delegate of the nssplitview, i can control a subview not becoming smaller than a certain value by implementing splitView:constrainMinCoordinate :ofSubviewAt: -- works fine.

when the window is being resized, everything is being resized proportionally. in that case, my delegate is not being called since it only gets called when the divider is being moved.
if i wanted to, i could register for NSSplitViewWillResizeSubviewsNotification, so i'd know when it will resize the subviews -- but i don't see a way of setting the position of the divider to prevent a subview of becoming smaller than a certain size when the window's size is being changed.

i tried registering to that notification and then manually setting the bounds of the concerned view but that resulted in the weirdest cocoa drawing flaw i've ever seen. all the buttons and stuff were stretched and looked like a distorted screenshot.

is that understandable? any hints?
     
seb2  (op)
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Nov 15, 2001, 02:51 AM
 
ok, so here i am replying to myself. found out that reading the class description helps.

i can actually, well, influence the divider's position by simply setting the frame of the two views within the splitview. simple.

so now, everything works as i thought it would. kind of.
if i slowly resize the window, it indeed won't resize the one view to something smaller than a certain size because i check that view's frame and if necessary set it to something bigger.

but... if i resize the window very quickly, it seems that the NSSplitViewWillResizeSubviewsNotification is being sent too late, for a fraction of a second, the view does get too small and some of the things i got in my view change their position like in an application which was badly designed in ib; buttons are atop each other.

so, i also react to the main window's windowWillResize:toSize: and check the size of the view there -- doesn't look better, either.

does anybody know why that notification is being sent so late and why my delegate isn't being called in time?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:51 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2