Le 7 avr. 08 à 14:10, Peter Zegelin a écrit :
On 07/04/2008, at 9:07 PM, Jean-Daniel Dupas wrote:
Le 7 avr. 08 à 12:14, Peter Zegelin a écrit :
I'm trying to constrain the value of an NSSlider (while it is
being dragged) depending on the state of a modifier key and being
totally new to Cocoa am getting nowhere really fast! For a start,
I don't seem to be able to find a way to test for a modifier key
during the actual drag.
Can anyone help me here?
thanks!
Peter
To get the current modifier state during an event, -[NSEvent
modifierFlags];
And -[NSApplication currentEvent] or -[NSWindow currentEvent] to
get the current event (if you do not already have it).
OK but given, say, my own slidercell subclass, which event should I
check in and how do I get a ref to the sliders window? I'm currently
using 'continueTracking' which seems to be the right event to
override:
You can get the ref window by using the -[NSView window] method. You
can get the current event by using the NSApp global variable (NSEvent
*event = [NSApp currentEvent];)
And see also the link in the Ron's message.
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]