Re: constrained window resizing
Re: constrained window resizing
- Subject: Re: constrained window resizing
- From: Ken Victor <email@hidden>
- Date: Thu, 23 Jun 2011 15:57:58 -0700
empirically, it appears that the event tracking loop for window resizing is calling
-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
so i can’t simply override NSWindow’s matching method in my subclass. thus, while overriding NSApplication’s method is probably doable, i believe it would be “messier” than quincey’s "low tech" solution, which can be encapsulated in my subclass. i will now give this a try and report back.
thanx quincey,
ken
On Jun 23, 2011, at 3:21 PM, Quincey Morris wrote:
> On Jun 23, 2011, at 14:55, Ken Victor wrote:
>
>> lets say the user had been resizing the window without any modifier keys pressed, but then realized what s/he really wanted was to resize in only one dimension or to maintain the window’s aspect ratio, so now s/he presses either shift or shift and control. i would like to be able to resize the window at this time to show the proper effect, but i can’t do this until the user moves the mouse AFTER changing the modifier keys.
>
> Don't overlook the possibility of a low tech solution. How about starting a repeating timer with an interval of (say) 0.1 secs, and checking the flags when the time fires? You'd probably want to "debounce" the timer by preventing it from triggering another resize when resizing is already in progress, and possibly for a short time afterwards.
>
>
_______________________________________________
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