• 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: Icon button with pop-up menu in toolbar?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Icon button with pop-up menu in toolbar?


  • Subject: Re: Icon button with pop-up menu in toolbar?
  • From: Håkan Waara <email@hidden>
  • Date: Tue, 13 Jun 2006 00:06:02 +0200

The trick is usually to override trackMouse: to provide this custom behavior. For example, do a nextEventMatchingMask: with a timeout. If it times out, it's a "click-hold" event, otherwise you just dispatch the mousedown normally.

Someone already made a great class for this. IIRC it's called AMRolloverButton or similar.

Otherwise, you can have a look at DraggableImageAndTextCell.mm in camino's source code. Less than perfect, but does the job.

/Håkan

12 jun 2006 kl. 16.36 skrev Fredrik Olsson:

Hi, no Google power today :/


What is the secret trick to implementing toolbar items that behaves like "Build" and "Build and Go" in Xcode?


A default action for single click, and a delay popup-menu with further action.


// Fredrik Olsson _______________________________________________ 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

_______________________________________________ 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
  • Follow-Ups:
    • Re: Icon button with pop-up menu in toolbar?
      • From: Fredrik Olsson <email@hidden>
References: 
 >Icon button with pop-up menu in toolbar? (From: Fredrik Olsson <email@hidden>)

  • Prev by Date: Re: Object for variable array of fixed structures
  • Next by Date: Re: NSTreeController woes... NSZombie at doc closed
  • Previous by thread: Icon button with pop-up menu in toolbar?
  • Next by thread: Re: Icon button with pop-up menu in toolbar?
  • Index(es):
    • Date
    • Thread