Re: Catching mouse-clicks outside UI elements
Re: Catching mouse-clicks outside UI elements
- Subject: Re: Catching mouse-clicks outside UI elements
- From: p3consulting <email@hidden>
- Date: Mon, 1 Dec 2003 15:25:56 +0100
On 1 dic. 2003, at 13:31, Marten van Gelderen wrote:
>
Hallo List,
>
>
I have a multi-document based application with a preferences panel. In
>
both types of window I want to react on a mouse click -outside- any UI
>
element. So I made the controller class and the document class
>
delegates of their respective windows and overrode
>
-(void)mouseDown:(NSEvent *)event.
>
>
This works fine in the preferences panel, but not in the document
>
windows. It's obvious that I'm doing something wrong (in the document
>
case), but I haven't figured out yet what. Any ideas? Thanks in
>
advance.
>
--
>
Groeten, Marten
>
_______________________________________________
>
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.
>
>
Why don't you put a view of your own (a sub-class of NSView of which
you override -(void)mouseDown) at the top of the view hierarchy ?
every mouse click that will not be in a sub-view will be in that one by
definition of the view hierarchy
You may also be interested to take a look at
- (NSView *)hitTest:(NSPoint)aPoint
NSView's instance method.
Pascal Pochet
email@hidden
_______________________________________________
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.