Customizing NSMenuItem
Customizing NSMenuItem
- Subject: Customizing NSMenuItem
- From: "Alan Smith" <email@hidden>
- Date: Tue, 31 Oct 2006 08:43:52 -0500
Hi all,
I'm making a theme framework. This framework will be embedded in my
app and will give me the ability to draw whatever UI widget I want,
however I want.
I'm confident I can do must of it all easily enough. There is only one
problem I have run into, drawing a menu item. I can squelch the
drawing easily enough but the method that does the drawing doesn't
pass in things like item title and key-commands and that stuff. Here
is the code:
OSStatus Hacking_HIThemeDrawMenuItem( const HIRect * inMenuRect,
const HIRect * inItemRect, const HIThemeMenuItemDrawInfo *
inItemDrawInfo, CGContextRef inContext, HIThemeOrientation
inOrientation, HIRect * outContentRect )
{
}
int main(int argc, char *argv[])
{
gOldMenuItem = APEPatchCreate(&HIThemeDrawMenuItem,
&Hacking_HIThemeDrawMenuItem);
return NSApplicationMain(argc, (const char **) argv);
}
inItemDrawInfo is limited and doesn't have the values I want.
I wish to know, either, how do I draw a complete custom menu item, or
has this been done already and if so can I have the code?
I saw the Camaelon project, after lots of searching, but that doesn't
work the way I want it to. It doesn't handle drawing of the items in
the main menu for example because NSMenuView is deprecated. :-(
I used Shark and found that the drawing of the text and ket code and
stuff is done in another method, called after this one. It should draw
text over anything I do in this method but it doesn't appear to,
literally.
All help is appreciated, Alan
PS. If anyone wants to join me in creating this framework please let
me know. I'd love to have some help.
PPS. Also note that I would prefer to get this to work as far back as 10.2.8.
--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unimportant, then it
shall evolve."
_______________________________________________
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