Re: Problem redrawing views while window resize button is held
Re: Problem redrawing views while window resize button is held
- Subject: Re: Problem redrawing views while window resize button is held
- From: Robert Clair <email@hidden>
- Date: Thu, 15 Mar 2007 09:47:12 -0400
You can probably do it, but it will be *very* messy.
Many of the controls track the mouse by grabbing control at mouse
down and then polling for mouseDragged and mouseUp by calling:
-[NSWindow nextEventMatchingMask:]
The widow resize isn't doing that. A mouse down on the resize corner
starts polling NSApp directly by calling:
-[NSApp nextEventMatchingMask:untilDate:inMode:dequeue:]
with a mask of 68.
This then blocks waiting for a left mouse drag or up. When it does
get a drag, it does the resize and polls again.
(I have instrumented versions of NSApplication and NSWindow with lots
of logging.)
So... you might be able to something very ugly along the lines of:
* Subclass NSApplication and override -[NSApp
nextEventMatchingMask:untilDate:inMode:dequeue:]
* Determine through whatever combination of overrides and flags that
you are here because you've pushed the mouse button on the resize
handle.
* Call drawRect on your view yourself and flush the window yourself.
* Post an NSApplicationDefined event to the queue
* Change the mask to include NSApplicationDefined and call super
* When the call to super finally returns check the event type. If it
is a drag or up, return. Otherwise do the drawing manually again,
post another event, and call super again. You might want to put a
small sleep in there to avoid churning.
...Bob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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