Re: nswindow resize question
Re: nswindow resize question
- Subject: Re: nswindow resize question
- From: Boaz Stuller <email@hidden>
- Date: Mon, 7 Jul 2003 20:43:31 -0400
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.