Re: Getting NSScrollView to ignore scrolling
However, as far as I recall, the scroll view is responsible for tiling and drawing the table column headers (and the little corner view). So, it's only a workable solution if you don't want headers over your table columns... On 21 Feb 2011, at 04:10:24, Scott Anguish wrote: although you have a solution, I’ll mention... You don’t HAVE to have a table view within a scroll view. There are situations in the system that are the case (sidebar in Finder, threads in mail). It’s just the normal case. On Feb 20, 2011, at 4:27 PM, Andrew Shamel wrote: Hurrah! It was as easy as this: - (void)scrollWheel:(NSEvent *)theEvent { [[self nextResponder] scrollWheel:theEvent]; } Thanks, y'all! — andy On Feb 19, 2011, at 4:48 PM, Quincey Morris wrote: On Feb 19, 2011, at 16:25, Peter Lübke wrote: My question is this: how do I get the scroll view to ignore scrolling messages? The tables/scrollviews are sitting on views that are part of a homebrew collection view, and the scrolling "catches" on them, even though there's no scrolling to be done. The scroll view is taking the events, but there is nothing for them to do. I want to be able to scroll past the table using a scrollwheel or the trackpad without the scrolling action "catching." What do you mean with "scroll past the table"? I'm pretty sure the OP is talking specifically about scrolling with the scroll wheel. (It sounds like the individual table views in his view collection don't have scroll bars, and are sized to show all their content anyway.) In that case, the table views or scroll views are still responding the scroll wheel, which prevents the collection view itself from scrolling. I think the only way to fix this is to override the appropriate 'scrollWheel:' event method, and to pass the event on up the responder chain. NSScrollView's documentation lists that method, so presumably that's the appropriate method, and so it would be necessary to subclass NSScrollView, override 'scrollWheel:' and figure out a way of bypassing the NSScrollView implementation (since the usual '[super scrollWheel:]' technique won't achieve that here). I guess you'd have to walk the responder chain manually (not normally recommended), or find the NSScrollView's superclass's implementation via the 'objc_...' runtime routines (not normally recommended), although maybe there's a simpler way that's just not occurring to me right now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com This email sent to sc...@cocoadoc.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/blue.buconero%40virgin.net This email sent to blue.bucon...@virgin.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
although you have a solution, I’ll mention... You don’t HAVE to have a table view within a scroll view. There are situations in the system that are the case (sidebar in Finder, threads in mail). It’s just the normal case. On Feb 20, 2011, at 4:27 PM, Andrew Shamel wrote: > Hurrah! It was as easy as this: > > - (void)scrollWheel:(NSEvent *)theEvent > { > [[self nextResponder] scrollWheel:theEvent]; > } > > Thanks, y'all! > > — andy > > > On Feb 19, 2011, at 4:48 PM, Quincey Morris wrote: > >> On Feb 19, 2011, at 16:25, Peter Lübke wrote: >> My question is this: how do I get the scroll view to ignore scrolling messages? The tables/scrollviews are sitting on views that are part of a homebrew collection view, and the scrolling "catches" on them, even though there's no scrolling to be done. The scroll view is taking the events, but there is nothing for them to do. I want to be able to scroll past the table using a scrollwheel or the trackpad without the scrolling action "catching." >>> >>> What do you mean with "scroll past the table"? >> >> I'm pretty sure the OP is talking specifically about scrolling with the >> scroll wheel. (It sounds like the individual table views in his view >> collection don't have scroll bars, and are sized to show all their content >> anyway.) In that case, the table views or scroll views are still responding >> the scroll wheel, which prevents the collection view itself from scrolling. >> >> I think the only way to fix this is to override the appropriate >> 'scrollWheel:' event method, and to pass the event on up the responder >> chain. NSScrollView's documentation lists that method, so presumably that's >> the appropriate method, and so it would be necessary to subclass >> NSScrollView, override 'scrollWheel:' and figure out a way of bypassing the >> NSScrollView implementation (since the usual '[super scrollWheel:]' >> technique won't achieve that here). I guess you'd have to walk the responder >> chain manually (not normally recommended), or find the NSScrollView's >> superclass's implementation via the 'objc_...' runtime routines (not >> normally recommended), although maybe there's a simpler way that's just not >> occurring to me right now. >> >> > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com > > This email sent to sc...@cocoadoc.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
On Feb 20, 2011, at 3:44 AM, Quincey Morris wrote: > For completeness, [...] In the spirit of completeness, I should mention that because of my particular situation I don't have to think about handling arrow keys or the page up/down keys. The other Andy (the OP) might care about handling these keys given that he's using a table view. > On Feb 20, 2011, at 00:17, Andy Lee wrote: [...] >> I notice WebKit does the expected thing with nested scroll views (for >> example in a typical web mail window in Safari). This includes cases where >> the inner scroll view *can* scroll. I actually find this annoying. In *this* >> case I'd prefer the scroll wheel to stop dead at the top or bottom. It's a >> Fitt's Law kind of thing for me; I want to be able to scroll, scroll, scroll >> to the bottom of a list and not have to be careful about scrolling so much >> that I shift the whole window contents around. But maybe arguments could be >> made the other way. > > I hate that too. And the reverse: sometimes I want to scroll the window but > end up scrolling a text field instead. > > Perhaps the real answer is that nested scrolling views just have *terrible* > usability, period. Could be. I thought of a case where I do want the outer scroll view to scroll: if the inner scroll view is partly outside of the clip view, then I want the outer scroll view to scroll at appropriate times to expose it. What I don't want is for the outer scroll view to *always* scroll when the inner scroll view has reached one of its extremes. > Or perhaps the best that could be done is for scroll views to pass > scrollWheel events up the responder chain *if* there's another scroll view > further up the chain (so that the scroll wheel is handled at the highest > possible level) *except* if the scrollWheel event is directly over a view's > scroll bar, in which case it would be processed by the scroll view that the > scroll bar belongs to. Would that work better? (The discoverability wouldn't > be great, though.) Whatever the logic is, I'd want it to be natural without the user having to realize there is any special-casing at all -- they just do what comes naturally. I do think there might be something to the idea of a scroll view checking whether it has an enclosingScrollView. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
Hurrah! It was as easy as this: - (void)scrollWheel:(NSEvent *)theEvent { [[self nextResponder] scrollWheel:theEvent]; } Thanks, y'all! — andy On Feb 19, 2011, at 4:48 PM, Quincey Morris wrote: > On Feb 19, 2011, at 16:25, Peter Lübke wrote: > >>> My question is this: how do I get the scroll view to ignore scrolling >>> messages? The tables/scrollviews are sitting on views that are part of a >>> homebrew collection view, and the scrolling "catches" on them, even though >>> there's no scrolling to be done. The scroll view is taking the events, but >>> there is nothing for them to do. I want to be able to scroll past the table >>> using a scrollwheel or the trackpad without the scrolling action "catching." >>> >> >> What do you mean with "scroll past the table"? > > I'm pretty sure the OP is talking specifically about scrolling with the > scroll wheel. (It sounds like the individual table views in his view > collection don't have scroll bars, and are sized to show all their content > anyway.) In that case, the table views or scroll views are still responding > the scroll wheel, which prevents the collection view itself from scrolling. > > I think the only way to fix this is to override the appropriate > 'scrollWheel:' event method, and to pass the event on up the responder chain. > NSScrollView's documentation lists that method, so presumably that's the > appropriate method, and so it would be necessary to subclass NSScrollView, > override 'scrollWheel:' and figure out a way of bypassing the NSScrollView > implementation (since the usual '[super scrollWheel:]' technique won't > achieve that here). I guess you'd have to walk the responder chain manually > (not normally recommended), or find the NSScrollView's superclass's > implementation via the 'objc_...' runtime routines (not normally > recommended), although maybe there's a simpler way that's just not occurring > to me right now. > > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
On Feb 20, 2011, at 00:17, Andy Lee wrote: > On Feb 19, 2011, at 7:48 PM, Quincey Morris wrote: > >> I think the only way to fix this is to override the appropriate >> 'scrollWheel:' event method, and to pass the event on up the responder chain. > > I have the same requirement as the OP: a scroll view that never needs to > actually scroll, but which nevertheless eats scrollWheel: events, which keeps > *its* containing scroll view from getting them. My solution was exactly as > you describe. For the inner scroll view I use a subclass of NSScrollView that > overrides scrollWheel: by sending scrollWheel: to its nextResponder, causing > the outer scroll view to eventually get it. You can use IB to set the class > of the inner scroll view to the subclass. For completeness, I should amend my statement: the alternative way suggested by Peter Lübke (creating the NSTableView programmatically without an enclosing scroll view) sounds viable too. OTOH, I guess you could avoid having to create and configure the table in code (possibly quite a bit of code) if you use IB to place the table, and then remove the enclosing NSScrollView from the view hierarchy in code. It's probably about the same amount of code as your solution, I dunno. > I notice WebKit does the expected thing with nested scroll views (for example > in a typical web mail window in Safari). This includes cases where the inner > scroll view *can* scroll. I actually find this annoying. In *this* case I'd > prefer the scroll wheel to stop dead at the top or bottom. It's a Fitt's Law > kind of thing for me; I want to be able to scroll, scroll, scroll to the > bottom of a list and not have to be careful about scrolling so much that I > shift the whole window contents around. But maybe arguments could be made the > other way. I hate that too. And the reverse: sometimes I want to scroll the window but end up scrolling a text field instead. Perhaps the real answer is that nested scrolling views just have *terrible* usability, period. Or perhaps the best that could be done is for scroll views to pass scrollWheel events up the responder chain *if* there's another scroll view further up the chain (so that the scroll wheel is handled at the highest possible level) *except* if the scrollWheel event is directly over a view's scroll bar, in which case it would be processed by the scroll view that the scroll bar belongs to. Would that work better? (The discoverability wouldn't be great, though.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
On Feb 19, 2011, at 7:48 PM, Quincey Morris wrote: > On Feb 19, 2011, at 16:25, Peter Lübke wrote: > >>> My question is this: how do I get the scroll view to ignore scrolling >>> messages? The tables/scrollviews are sitting on views that are part of a >>> homebrew collection view, and the scrolling "catches" on them, even though >>> there's no scrolling to be done. The scroll view is taking the events, but >>> there is nothing for them to do. I want to be able to scroll past the table >>> using a scrollwheel or the trackpad without the scrolling action "catching." >>> >> >> What do you mean with "scroll past the table"? > > I'm pretty sure the OP is talking specifically about scrolling with the > scroll wheel. (It sounds like the individual table views in his view > collection don't have scroll bars, and are sized to show all their content > anyway.) In that case, the table views or scroll views are still responding > the scroll wheel, which prevents the collection view itself from scrolling. > > I think the only way to fix this is to override the appropriate > 'scrollWheel:' event method, and to pass the event on up the responder chain. I have the same requirement as the OP: a scroll view that never needs to actually scroll, but which nevertheless eats scrollWheel: events, which keeps *its* containing scroll view from getting them. My solution was exactly as you describe. For the inner scroll view I use a subclass of NSScrollView that overrides scrollWheel: by sending scrollWheel: to its nextResponder, causing the outer scroll view to eventually get it. You can use IB to set the class of the inner scroll view to the subclass. I wonder if this is worth a Radar: "If a scroll view doesn't actually do anything in response to a scrollWheel: event, it should forward the event to nextResponder." This seems to me to be what the responder chain is *for*. I notice WebKit does the expected thing with nested scroll views (for example in a typical web mail window in Safari). This includes cases where the inner scroll view *can* scroll. I actually find this annoying. In *this* case I'd prefer the scroll wheel to stop dead at the top or bottom. It's a Fitt's Law kind of thing for me; I want to be able to scroll, scroll, scroll to the bottom of a list and not have to be careful about scrolling so much that I shift the whole window contents around. But maybe arguments could be made the other way. Anyway, you can get whatever behavior you need by overriding scrollWheel:. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
On Feb 19, 2011, at 16:25, Peter Lübke wrote: >> My question is this: how do I get the scroll view to ignore scrolling >> messages? The tables/scrollviews are sitting on views that are part of a >> homebrew collection view, and the scrolling "catches" on them, even though >> there's no scrolling to be done. The scroll view is taking the events, but >> there is nothing for them to do. I want to be able to scroll past the table >> using a scrollwheel or the trackpad without the scrolling action "catching." >> > > What do you mean with "scroll past the table"? I'm pretty sure the OP is talking specifically about scrolling with the scroll wheel. (It sounds like the individual table views in his view collection don't have scroll bars, and are sized to show all their content anyway.) In that case, the table views or scroll views are still responding the scroll wheel, which prevents the collection view itself from scrolling. I think the only way to fix this is to override the appropriate 'scrollWheel:' event method, and to pass the event on up the responder chain. NSScrollView's documentation lists that method, so presumably that's the appropriate method, and so it would be necessary to subclass NSScrollView, override 'scrollWheel:' and figure out a way of bypassing the NSScrollView implementation (since the usual '[super scrollWheel:]' technique won't achieve that here). I guess you'd have to walk the responder chain manually (not normally recommended), or find the NSScrollView's superclass's implementation via the 'objc_...' runtime routines (not normally recommended), although maybe there's a simpler way that's just not occurring to me right now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting NSScrollView to ignore scrolling
HI All, I have a NSTableView/NSScrollView setup that I've configured automatically to resize to contain the content of the table. This may sound silly, but I don't want scrolling behavior, but NSTableView seems to be designed to be inside a NSScrollView. My question is this: how do I get the scroll view to ignore scrolling messages? The tables/scrollviews are sitting on views that are part of a homebrew collection view, and the scrolling "catches" on them, even though there's no scrolling to be done. The scroll view is taking the events, but there is nothing for them to do. I want to be able to scroll past the table using a scrollwheel or the trackpad without the scrolling action "catching." What do you mean with "scroll past the table"? Did you try to call setHasHorizontalScroller:NO, setHasVerticalScroller: NO, setHasHorizontalRuler:NO, setHasVerticalRuler:NO and setLineScroll:0.0 on the enclosing scroll view? You can create your own table view without an enclosing scroll view; there's some more work to do than simply dragging an NSTableView into a window in IB. Create an NSTableView subclass, add your table columns, override -calcSize and -sizeToFit to fit your resizing behaviour, and add it wherever it is supposed to be in your view hierarchy. Start creating instances with [[myTableView alloc] - initWithFrame:...]. Cheers, Peter ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Getting NSScrollView to ignore scrolling
HI All, I have a NSTableView/NSScrollView setup that I've configured automatically to resize to contain the content of the table. This may sound silly, but I don't want scrolling behavior, but NSTableView seems to be designed to be inside a NSScrollView. My question is this: how do I get the scroll view to ignore scrolling messages? The tables/scrollviews are sitting on views that are part of a homebrew collection view, and the scrolling "catches" on them, even though there's no scrolling to be done. The scroll view is taking the events, but there is nothing for them to do. I want to be able to scroll past the table using a scrollwheel or the trackpad without the scrolling action "catching." Any ideas? Thank you so much!! Pax, Andy Shamel___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com