• 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: NSSlider's mouseDown implementation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSlider's mouseDown implementation


  • Subject: Re: NSSlider's mouseDown implementation
  • From: email@hidden
  • Date: Mon, 10 Jun 2002 23:38:19 -0500

If you draw your custom view in the status bar(or anywhere else), the aqua window pattern will show through it. To highlight it, call this method:
[[NSColor colorWithDeviceRed:.2 green:.4 blue:.8 alpha:1] set];
then:
NSRectFillUsingOperation([imageView frame], NSCompositePlusLighter);
where imageView is the custom view that you are working with.
If you are really picky you can tweak the color a little to have it match the true system highlight color. There should be a way to figure it out programaticly, but I don't know that much about color math. There is a method to find the standard highlight color, which is what should be used.
more info on NSRectFillUsingOperation can be found at
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/
ObjC_classic/Functions/AppKitFunctions.html#BAJJABBF

On Monday, June 10, 2002, at 03:43 PM, Sanford Selznick wrote:

Hello,
I saw your message where you were writing a custom NSStatusItem. I'm doing the same now too. If I may ask, you create your own NSView for the NSStatusItem. How does one draw the menu with the blue background and show the menu itself? It appears that creating an NSView overrides both drawing /and/ behavior. I can't help but feel that I'm missing something obvious.

Thanks,
Sanford
_______________________________________________
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: Drag and Drop Oddities
  • Next by Date: Newbie on printing views
  • Previous by thread: Re: Drag and Drop Oddities
  • Next by thread: Re: NSSlider's mouseDown implementation
  • Index(es):
    • Date
    • Thread