• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Issue with NSView setFrame
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue with NSView setFrame


  • Subject: Issue with NSView setFrame
  • From: PCWiz <email@hidden>
  • Date: Mon, 12 Oct 2009 14:42:15 -0600

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


  • Follow-Ups:
    • Re: Issue with NSView setFrame
      • From: Jesper Storm Bache <email@hidden>
    • Re: Issue with NSView setFrame
      • From: Dave Keck <email@hidden>
  • Prev by Date: Re: CoreData Bug? (SQLite vs XML) + isolated reproducible case
  • Next by Date: Re: CoreData Bug? (SQLite vs XML) + isolated reproducible case
  • Previous by thread: Re: CoreData Bug? (SQLite vs XML) + isolated reproducible case
  • Next by thread: Re: Issue with NSView setFrame
  • Index(es):
    • Date
    • Thread