• 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: Catching mouse-clicks outside UI elements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Catching mouse-clicks outside UI elements (From: Marten van Gelderen <email@hidden>)

  • Prev by Date: Does an enumerator retain the last object?
  • Next by Date: Re: rounding a float
  • Previous by thread: Catching mouse-clicks outside UI elements
  • Next by thread: Re: Catching mouse-clicks outside UI elements
  • Index(es):
    • Date
    • Thread