Re: Highlighting NSView used in NSStatusItem
Re: Highlighting NSView used in NSStatusItem
- Subject: Re: Highlighting NSView used in NSStatusItem
- From: "I. Savant" <email@hidden>
- Date: Fri, 12 Oct 2007 13:09:34 -0400
> Thanks for the reply, but I guess what the necessary behavior is, is at
> least part of my question. I already override mouseDown
> to get the menu to display. I tried using drawing routines to fill the
> view's rect with the systemhiglight color as a part of mouseDown, but
> that came out looking pretty awful. What I got was my view being
> completely overwhelmed by the hightlight color (which wasn't the correct
> color anyway). The text which is part of my view did not 'invert' its
> color and the view's image was completely obscured.
Your problem is that you are simply not reading the manual. All
drawing should be done in (or called from) the -drawRect: method.
Randomly drawing at arbitrary times is a bad idea.
Read this: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Introduction/chapter_1_section_1.html
... and this:
http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/MouseTrackingEvents/chapter_7_section_2.html
... and keep in mind that you need to set a state when the mouse
enters/exits/moves/whatever, then flag your view as needing display
(per the first link I sent you). When -drawRect: is called, you'll
draw your view based on the current states.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden