Comments (8)
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
The docs on Apple’s page say the following:
This method is invoked before the NSSplitView begins tracking the cursor to position a divider. You may further constrain the limits that have been already set, but you cannot extend the divider limits. proposedMin is specified in the NSSplitView’s flipped coordinate system. If the split bars are horizontal (views are one on top of the other), proposedMin is the top limit. If the split bars are vertical (views are side by side), proposedMin is the left limit. The initial value of proposedMin is the top (or left side) of the subview before the divider. offset specifies the divider the user is moving, with the first divider being 0 and going up from top to bottom (or left to right).
So it sounds like it should only be called during repositioning of the divider. Could you possibly do a test against Cocoa to see whether this is actually the case?
by Francisco Tolmasky
from cappuccino.
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
Ok, I wrote a little cocoa app and this method does get called when the window is resized as well as when the divider is repositioned.
I attached the project if you care to see for yourself...
by Patrick Crosby
from cappuccino.
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
Cool, I’ll try to fix this tomorrow then
by Francisco Tolmasky
from cappuccino.
CPSplitView doesn’t honor splitView:constrainMinCoordinate:ofSubviewAt: when resizing window
This hasn’t been fixed in 0.7b yet.
Here is a test case :
http://gist.github.com/83999
by Thomas Balthazar
from cappuccino.
http://github.com/stevegeek/CappuccinoBugs/tree/master/i0041/ I have commited the test here, and I do not see the problem anymore
from cappuccino.
I do not believe this is a bug. Cocoa's NSSplitView performs in the exact same manner (unfortunately).
I think the proper solution is the delegate method splitViewDidResizeSubviews:
For example, in my app, my constrained, min, and max positions are all 151, so I implemented the following delegate method.
-(void) splitViewDidResizeSubviews:(CPNotification)notification { [splitView setPosition:151 ofDividerAtIndex:0]; }
Obviously, you can change this to test the size of the resized subviews and if below a minimum or greater than a maximum, set the position of the divider accordingly. In Cocoa, I have found at least one framework that subclassed NSSplitView to handle this with attributes instead of a delegate. See http://brandonwalkin.com/bwtoolkit/ The source code is included.
from cappuccino.
This still happens in Cappuccino, I need to check if it happens in Cocoa.
from cappuccino.
The behavior you are seeing is correct according to Cocoa. The way to do what you want is covered here:
The -adjustSubviews method has been added to CPSplitView.
from cappuccino.
Related Issues (20)
- Default-Button has wrong colors HOT 14
- Toolbar action-icon does not show HOT 11
- CPDatePicker: separator labels are clipped 1 pixel HOT 4
- CPStepper: lower Y-position is off 1-2 pixels HOT 5
- CPSearchField is not working HOT 9
- Text from buttons in alertboxes is not well centered HOT 7
- Github Issues app is no longer maintained, should be archived HOT 1
- nib2cib fails to convert xibs with target set later than macOS 10.12 HOT 6
- Using `xmldom` with critical security vulnerability HOT 1
- A3 branch vs latest version Didier: setDefaultButton does not give correct background HOT 5
- A3 branch vs latest version Didier: CPButtonBar loads button twice HOT 6
- A3 branch vs latest version Didier: CPPopUpButton does not appear HOT 7
- CPString has not method -(BOOL)containsString:(CPString)aString HOT 1
- CPAlertPanel is not re-themed HOT 5
- ActionsButton pulldown should not have a selection checkmark HOT 3
- CPButtonBar: actions buttons do not give visual feedback when pressed HOT 2
- XcodeCapp build configuration fails with Xcode 15 HOT 2
- Node package missing lib HOT 5
- bootstrap.sh incorrectly parses Java version HOT 9
- "jake docs" fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cappuccino.