• 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: First click when activated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First click when activated


  • Subject: Re: First click when activated
  • From: "Tim Buchheim" <email@hidden>
  • Date: Tue, 9 May 2006 17:40:41 -0700

On 5/9/06, Valerio Ferrucci <email@hidden> wrote:

when my app is in background and the user click on the app window,
with a single the click he brings the app forward and make an action
(i.e. press a button on the window).

How can I avoid this?

that is: I want my user to do 2 clicks, one to activate the app and
one to make an action (press a button on the window etc...)


For the views which you don't want the user to be able to click on
while the window is not front-most, try overriding -
(BOOL)acceptsFirstMouse:(NSEvent *)theEvent

Views which are subclasses of NSControl typically return YES ... you
want to return NO.  See the documentation at

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSView.html#//apple_ref/occ/instm/NSView/acceptsFirstMouse:


Note that the human interface guidelines suggest that most buttons and other controls should allow click-through. Exceptions should be made, however, for anything dangerous (such as a "delete" button) which you don't want the user to click accidentally while attempting to bring the window forward.




-- Tim Buchheim _______________________________________________ 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: 
 >Clip/ScrollView image scrambling (From: Scott Thompson <email@hidden>)
 >Re: Clip/ScrollView image scrambling (From: "I. Savant" <email@hidden>)
 >First click when activated (From: Valerio Ferrucci <email@hidden>)

  • Prev by Date: NSOpenPanel causing hang on subsequent NSTask
  • Next by Date: Does there exist a Cocoa compatibility test tool?
  • Previous by thread: Re: First click when activated
  • Next by thread: Re: Clip/ScrollView image scrambling
  • Index(es):
    • Date
    • Thread