• 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: Fake NSMenu-like view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fake NSMenu-like view


  • Subject: Re: Fake NSMenu-like view
  • From: Brian Ganninger <email@hidden>
  • Date: Mon, 30 Jan 2006 13:13:04 -0600

Hmm. What about creating a matrix of custom (likely nsbutton subclass) cells where the custom cell contains its own mouseEntered: code that draws a highlight as the background and draws a 'clean' background when mouseExited:

This would give you rollover behavior and button click functionality, which if coded correctly should be able to reasonably approximate a 'menu' effect.

On Jan 30, 2006, at 12:02 PM, Daniel Jalkut wrote:

Thanks, Brian. You get exactly why I can't just use a standard NSMenu.

What you describe below is what I'm already doing, though. That's "the easy part" :)

The question is how to best implement the part of that custom window such that it looks and acts like a menu. Sorry if I wasn't clear about this in my original post.

If people will just take it at face value that I want a *view* that looks like an NSMenu, I think my entire question is well contained in that desire :)

Daniel

On Jan 30, 2006, at 12:05 PM, Brian Ganninger wrote:

As to how, I believe one approach would be to use NSStatusMenuItem (or NSMenuExtra if you feel the need to use private APIs, being sure it can break and should at the bare minimum get an enhancement request) and get the click's location and/or the location of the menubar and then position a borderless, non- draggable window that you draw as you see fit (within a relative distance to the event/item itself) to create a 'seamless' look and feel.


_______________________________________________ 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: Fake NSMenu-like view
      • From: Daniel Jalkut <email@hidden>
References: 
 >Fake NSMenu-like view (From: Daniel Jalkut <email@hidden>)
 >Re: Fake NSMenu-like view (From: Joshua Scott Emmons <email@hidden>)
 >Re: Fake NSMenu-like view (From: Brian Ganninger <email@hidden>)
 >Re: Fake NSMenu-like view (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: Re: Menu items disabled - Loading a ui framework from cocoa app
  • Next by Date: Re: programmatically updating an MO's attribute/field
  • Previous by thread: Re: Fake NSMenu-like view
  • Next by thread: Re: Fake NSMenu-like view
  • Index(es):
    • Date
    • Thread