• 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
Re: Preventing menu shortcuts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing menu shortcuts


  • Subject: Re: Preventing menu shortcuts
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Sat, 4 Dec 2004 19:47:49 -0800

Hello...

You can create an event tracking loop in the code that initates the window drag, similar to what is described in the "Handling Mouse Events in Views" section of the conceptual topic on "Basic Event Handling" which has an example of an event tracking loop for NSButton near the end.
<http://developer.apple.com/documentation/Cocoa/Conceptual/BasicEventHandling/Tasks/HandlingMouseEvents.html#//apple_ref/doc/uid/20000906>


You would basically just need to change the actions for the switch statement, moving the window appropriately for the NSLeftMouseDragged case, and setting the bool to end the loop for the NSLeftMouseUp case. If your timer also does something else like run some sort of animation, you'll want to add periodic events to your event tracking loop as described in the paragraph right after the example.

Hope that helps,

	Louis


I have custom window dragging code that runs in a timer, and I'd like to prevent the user from being able to use menu shortcuts while they are dragging the window, as the standard window dragging behavior does (I don't want the user to close the window or quit the application while they are dragging a window, for example). How is this accomplished? Do I need to run a modal loop for the window being dragged or is there a better way?

Tim


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Absolute Value |x - y|
  • Next by Date: Re: Getting NSScroller to respond to mouseUp: method
  • Previous by thread: Re: Framework installation???
  • Next by thread: Re: Getting NSScroller to respond to mouseUp: method
  • Index(es):
    • Date
    • Thread