Re: Issue with NSView setFrame
Re: Issue with NSView setFrame
- Subject: Re: Issue with NSView setFrame
- From: Jesper Storm Bache <email@hidden>
- Date: Mon, 12 Oct 2009 14:38:54 -0700
- Acceptlanguage: en-US
- Thread-topic: Issue with NSView setFrame
Maybe the fact that your view is growing while you move your mouse
(and under your mouse) is causing AppKit to become confused about
whether or not the mouse is inside or outside the view.
What about managing your animations from a mouse-move message on the
NSCollectionView?
Jesper
On Oct 12, 2009, at 1:42 PM, PCWiz wrote:
> I have an NSCollectionView full of NSViews containing NSImageViews.
> Basically looks like a NSMatrix of NSImageCells. I've subclassed the
> NSCollectionView's prototype NSView and added methods to add a
> "magnification" sort of effect when a user hovers on an item:
>
> - (void)mouseEntered:(NSEvent *)theEvent
> {
> [[self animator] setFrame:NSMakeRect([self frame].origin.x, [self
> frame].origin.y, [self frame].size.width * 1.3, [self
> frame].size.height * 1.3)];
> }
>
> - (void)mouseExited:(NSEvent *)theEvent
> {
> [[self animator] setFrame:NSMakeRect([self frame].origin.x, [self
> frame].origin.y, [self frame].size.width / 1.3, [self
> frame].size.height / 1.3)];
> }
>
> This works for the most part, if I hover over the items slowly. As
> soon as I start zipping my mouse around fast, the views become all
> disoriented. Here's a video I took of the problem:
>
> http://twitvid.com/6426F
>
> I'm not sure what I'm doing wrong here. Also, how do I make it so that
> the frame size increases from the center of the view outwards. Like
> right now it looks like its magnifying from the left to the right. I'm
> sure theres something I need to do with the origin, but I'm not sure.
>
> Thanks
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden