Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: mouseDown/Up on window's titlebar?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mouseDown/Up on window's titlebar?



On Jan 31, 2005, at 12:03 PM, Ken Tabb wrote:

I need to detect mouseDown / mouseUp / mouseDragged events on a window's titlebar - I'm implementing sticky windows (snappable palettes). These events are sent correctly when the mouse is in the content view, but not in the window's titlebar... mouseDragged is sent but not mouseDown / mouseUp.

I could set my window subclass as it's own delegate so that it receives the -windowWillMove and -windowDidMove notifications, which roughly speaking mimic mouseDown / mouseUp in terms of indicating the mouse state, however there are some circumstances when they don't work reliably enough for my needs.

Why is it not adequate to simply know when the window moved? Why do you need to know when the mouse is pressed and released?


If you just need to know whether the mouse is up or down when you recieve your windowDidMove notification, you can use NSApplication's currentEvent method to grab the event being processed and check the events modifier flags for mouse state.

_murat

_______________________________________________
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


References: 
 >mouseDown/Up on window's titlebar? (From: Ken Tabb <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.