nsscrollview

NSTextView inside NSScrollView not co-operating while scrolling

 ̄綄美尐妖づ 提交于 2019-12-11 15:53:34
问题 I have a TableView which has NSTextView as cells. this is a situation where I have scrollView inside scrollView. Now when I scroll the contents of the textView, and when the textview's content reaches the end, I want the parent scrollView ( the tableView ) to continue scrolling. But by default this does not happen. Instead the parent doesn't scroll at all when the mouse pointer is inside the textView. I want to achieve something like in this example. This is my solution: public class

Cocoa Autolayout: insert (and remove) view programmatically at runtime

六月ゝ 毕业季﹏ 提交于 2019-12-11 09:33:59
问题 I have some issues with Cocoa Autolayout. I have a window and I add (programmatically) a NSTableView (with its NSScrollView ). Until now everything is ok. I can resize my window and the table resizes correctly. This is the code I used. MyListViewController *viewController = [[MyListViewController alloc] initWithNibName:@"ListView" bundle:nil]; [self.mainContentView addSubview:viewController.view]; [viewController.view setTranslatesAutoresizingMaskIntoConstraints:NO]; [self.mainContentView

Swift NSScrollView better NSViewBoundsDidChangeNotification observing?

丶灬走出姿态 提交于 2019-12-11 08:06:06
问题 Is there a better way to observe NSScrollView -> NSClipView frame/bounds change? This is Obj-C code translated to Swift: public override init(frame frameRect: NSRect) { self.contentView.postsFrameChangedNotifications = true; NSNotificationCenter.defaultCenter().addObserver( self, selector: "frameDidChange:", name: NSViewFrameDidChangeNotification, object: self.contentView) } deinit { NSNotificationCenter.defaultCenter().removeObserver( self, name: NSViewFrameDidChangeNotification, object:

NSScrollView: Make sure frame is visible

你。 提交于 2019-12-11 07:48:21
问题 I have an NSCollectionView that lists items from a Core Data source. Each item has a button that when fired slides down an action view. When this view slides down, the collection view shrinks so that both views fit on top of each other in the same window space. To provide a good user experience I want the NSCollectionViewItem that fired the action to be completely visible. I have it's frame - which I got from -frameForItemAtIndex: . How can I - using the NSRect frame variable and my

Can't get View to be drawn in NSScrollView

醉酒当歌 提交于 2019-12-11 05:58:29
问题 I am confused about how to implement a NSScrollView in the most basic way, so I will describe exactly what I do and hope that it is just to late for me to find my error: Create Xcode project. Adding a NSScrollView into MainMenu.xib. Creating new class inherited from NSView with the drawing method: (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; [[NSColor redColor] set]; NSRectFill(dirtyRect); } Define the view of the NSScrollView to be that new class. I expected to see a

Cocoa Scroll view keeps bouncing on mavericks in the middle of the file

给你一囗甜甜゛ 提交于 2019-12-10 20:55:33
问题 Does anybody know why when scrolling (via two finger touch) rapidly up and down it "catches" quite often and bounces incorrectly in the middle of a scrollview? This behavior is quite annoying and makes for a bad user experience. Xcode has scrollviews which bounce both horizontally and vertically and doesn't nearly-as-often get stuck this way. 回答1: That seems like a bug in NSScrollView. You can enable predominant axis scrolling, which mostly eliminates the problem: scrollView

NSScrollView scroll bars are of the wrong length

为君一笑 提交于 2019-12-10 19:18:15
问题 I have a Cocoa window, whose content view contains an NSScrollView that, in turns, contains a fixed-size NSView. Upon launching the program, the scroll bars displayed initially are too small, as if the content size was much larger than it actually is: When I start playing with, e.g., the vertical scroll bar, and bring it back to the original position at the top, it gets resized to its expected size (which corresponds to the ratio of scroll view and content view sizes): (Notice the horizontal

NSScrollView in a NSWindow

試著忘記壹切 提交于 2019-12-10 17:17:23
问题 I have an NSScrollView inside an NSWindow, but it seems to be disabled. It looks like it would work, but the scrollbars are unresponsive to the mouse or the scroll wheel. When I put the exact same NSScrollView inside a window on a new XCode project, it works perfect. There is something about the way I am making the window that is preventing the scroll from working. I've been able to simplify it to this example: //Make a window NSWindow* myWindow = [[NSWindow alloc] initWithContentRect

Blue border appearing around NSScrollView

烂漫一生 提交于 2019-12-10 17:13:48
问题 I'm sure this is normal and I'm just misunderstanding something, but since making one of my NSScrollView s slightly inset from the bottom of the window (as opposed to taking the full height), a blue border has appeared around it. I've set NSNoBorder on the scroll view, so this must be something else. [scrollView setBorderType:NSNoBorder]; Any pointers would be greatly appreciated. I'd like the border to go away as it spoils the look of the app and just looks broken. I assume it's the scroll

NSTableView redraw not updating display, selection sticking

我的梦境 提交于 2019-12-10 15:46:13
问题 Although I know of a solution to this problem, I am interested if someone can explain this solution to me. I also wanted to get this out there because I could not find any mention of this problem online, and it took me several hours over several days to track down. I have an NSTableView behaving strangely regarding redraws and its selection. The problem looks like this: Table contents fades in, instead of appearing instantly upon it's appearance on screen. When scrolling through the contents,