Very basic scenario:
I have a NSTableView in my nib with an outlet pointing to it. I have the following in my app delegate:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSScrollView *scroller = [tableView enclosingScrollView];
[scroller setHasVerticalRuler: YES];
[scroller setRulersVisible: YES];
}
The ruler gets displayed overtop of my tables headers (any any content):
See how column 1 is only partially visible. If I try the same exact thing with a textview, then it works perfect, the cursor gets indented and the text is clearly visible:
Could anyone point out what I'm doing wrong?
Edit: I've discovered that this is an issue with Yosemite that did not exist on older OS X versions. I've submitted a bug reports, but I guess the question would now be, does anybody know of a workaround?
A sample project has been uploaded here.
The problem is in the NSScrollView, and it's not your fault. Basically, the reason why column1 is partially visible is because the horizontal scroller has an offset.
Anyway, this worked for me:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSScrollView *scroller = [tableView enclosingScrollView];
[scroller setHasVerticalRuler: YES];
[scroller setRulersVisible: YES];
NSPoint pointToScrollTo = NSMakePoint ( -25 , 0 );
[[scroller contentView] scrollToPoint: pointToScrollTo];
[scroller reflectScrolledClipView: [scroller contentView]];
}
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With