On Apr 16, 2008, at 12:38 PM, Colin Cornaby wrote:

The issue is that I really need a rect. Getting the actual image of what is selected will tell me the width and height of the rect, but not the x and y.

So, you're after the origin of the rect in addition to the dimensions? Since IKImageView inherits from NSResponder, you can capture the mouse coordinates in the -mouseDown: event and then again using - mouseDragged:. Off the cuff, you'll then need to set the origin to the minimum x value and minimum y value of the two points and set the size to the max x-min x and max y-min y. (There's a good example of this in Hillegass, Cocoa Programming for Mac OS X, 2nd ed if you have it handy.)

All that being said, I have to ask what functionality you are using from IKImageView that you couldn't get from NSImageView? The above would apply to NSImageView, too, but you wouldn't be including all the IK goodness of IKImageView such as editing and NSImageView is supported on more than just Leopard. Just a thought.

HTH
Jamie
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to