Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fake NSMenu-like view



On 31/gen/06, at 23:47, Daniel Jalkut wrote:

Thanks, Camillo. Definitely some interesting drawing utilities in there that I hadn't noticed. I see that they became public in 10.3, which I might be amenable too. I also see however that they are poorly documented, outside of the HITheme.h header file.

Fortunately, the HITheme APIs are pretty straightforward and the headers explain the various parameters and fields. You can use this for the HIRect parameters (HIRect = CGRect):


static inline CGRect CGRectFromNSRect(NSRect nsRect) { return * (CGRect*)&nsRect; }

this for the orientation parameter:

[view isFlipped] ? kHIThemeOrientationNormal : kHIThemeOrientationInverted

and this for the CGContextRef:

(CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]

HITheme is a modernization of the Appearance APIs, so you can look at the Appearance Manager documentation for general usage information.

On 31/gen/06, at 23:49, John Stiles wrote:
Prior to HITheme APIs, there was the Appearance Manager, which had a similar mission--allow developers to render the Aqua controls-- but existed all the way back OS 8 (and I think you could install it onto 7.6 as an extension, as well...?).

I think it has some limitations in the OS X world--e.g. there are controls which it can't render--but it might be worth investigating for the ultimate in compatibility.

The biggest problem of the old Appearance Manager APIs is that they use QuickDraw for drawing, so you need to have a QD port around. This is not a huge problem for Carbon, but in Cocoa it would force you to use an NSQuickDrawView, unless there is another method of getting a QD port.


Camillo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Fake NSMenu-like view (From: Daniel Jalkut <email@hidden>)
 >Re: Fake NSMenu-like view (From: Camillo Lugaresi <email@hidden>)
 >Re: Fake NSMenu-like view (From: Daniel Jalkut <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.