Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nswindow resize question



NSView classes have 3 methods, -inLiveResize, -viewDidBeginLiveResize and -viewDidEndLiveResize, that let you know if you're in a live resize. Just check -inLiveResize in your drawInRect: method to decide when to cut back on the updating, and then call [self setNeedsDisplay:YES] in -viewDidEndLiveResize to get it to redraw correctly at the end. All this assumes that you are making a custom subclass of NSImageView to do all this.

One other method you should be aware of is NSGraphicContext's -setImageInterpolation: method. You can use this to switch to a faster image scaling method, like NSImageInterpolationNone, in -viewDidBeginLiveResize and switch back to the better one in -viewDidEndLiveResize.

Bo

On Monday, July 7, 2003, at 07:50 PM, Bill So wrote:

However, windowDidResize is invoked when I am still dragging the mouse. And so, the image is refreshed for many times during the course.

I'd like to do the refresh only when the user releases the mouse.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >nswindow resize question (From: Bill So <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.