Re: Custom window w/close
Re: Custom window w/close
- Subject: Re: Custom window w/close
- From: Andreas Mayer <email@hidden>
- Date: Fri, 5 Mar 2004 10:39:12 +0100
Am 05.03.2004 um 00:04 schrieb Dave Hersey:
Should I be delegating mouseMoved whenever the window is open, or is
there a
more system-friendly way to do the highlighting?
Use a tracking rectangle:
http://developer.apple.com/documentation/Cocoa/Conceptual/
BasicEventHandling/Tasks/HandlingMouseTracking.html
How do I get the click that activated me and make it go to my window's
close
handler? Right now, the app just comes forward.
You need to return YES from the view's acceptsFirstMouse:
--------
acceptsFirstMouse:
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
Overridden by subclasses to return YES if the receiver should be sent a
mouseDown: message for theEvent, an initial mouse-down event over the
receiver in its window, NO if not. The receiver can either return a
value unconditionally, or use the location of theEvent to determine
whether or not it wants the event. NSViews implementation ignores
theEvent and returns NO.
Override this method in a subclass to allow instances to respond to
initial mouse-down events. For example, most view objects refuse an
initial mouse-down event, so the event simply activates the window.
Many control objects, however, such as NSButton and NSSlider, do accept
them, so the user can immediately manipulate the control without having
to release the mouse button.
--------
Andreas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.