• 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: NSStatusItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSStatusItem


  • Subject: Re: NSStatusItem
  • From: Adam Atlas <email@hidden>
  • Date: Thu, 21 Mar 2002 12:12:02 -0500

Try making a custom view that does something like:
When drawing, check value of BOOL isDown. If YES, draw inverted image and/or white text, otherwise draw normal image and/or black text.
On mouseDown, set isDown=YES and setNeedsDisplay:YES.
On mouseUp, set isDown=NO and setNeedsDisplat:NO.
On mouseDragged (or whatever that method is called) check if mouse is still in bounds. If NO, blah, blah, blah. You know what i'm saying. :)

Then, I believe NSStatusItem has a setView:(NSView*)aView method. Call it with an instance of your new view. Don't call setImage or anything, just setView.

By the way, Apple's standard status items are actually Menu Extras, an enhanced subclass of NSStatusItem, but it's a private API.

--
Adam Atlas
Atomm Software
http://www.atommic.com
_______________________________________________
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.

  • Prev by Date: Re: isKindOfClass vs. loading bundles: nope?!?!?!?
  • Next by Date: Dragging Images And Strings Together
  • Previous by thread: NSStatusItem
  • Next by thread: Dragging Images And Strings Together
  • Index(es):
    • Date
    • Thread