• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
constrained window resizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

constrained window resizing


  • Subject: constrained window resizing
  • From: Ken Victor <email@hidden>
  • Date: Wed, 22 Jun 2011 14:21:18 -0700

i’ve got a subclass of NSWindow (MagneticWindow) that provides:
	- (NSSize) windowWillResize: (NSWindow*) sender toSize: (NSSize) frameSize;
i use this to provide constrained live resizing of the window, i.e., if the shift key is down, the window will only resize in the horizontal or vertical direction (based on the mouse’s position relative to where it was at mouse down time), and if the shift and control keys are both down, then the window will maintain its aspect ratio as it is resized.

this is all working fine except for one minor point: i don’t get called if any of the keys change their state (e.g., when the shift is let up) until the user moves the mouse. since the framework is running its own runloop for resizing, i don’t see how to “hook in”. and while this class has overridden sendEvent to provide its own runloop for dragging windows around (to provide similar constraining), i don’t really want to have to do this for resizing as i’m not sure of all the methods i would have to call to get live resizing drawing working properly.

can anyone suggest a way i can get informed when any of the modifier keys change their state while in the midst of live resizing (without requiring mouse movement)?

thanx,
ken

_______________________________________________

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

  • Follow-Ups:
    • Re: constrained window resizing
      • From: Ken Tozier <email@hidden>
  • Prev by Date: Re: Synthesised properties and additional actions
  • Next by Date: Re: constrained window resizing
  • Previous by thread: acceptsFirstMouse doesn't work SOLVED
  • Next by thread: Re: constrained window resizing
  • Index(es):
    • Date
    • Thread