Re: NSSliderCell, lockFocus question
Re: NSSliderCell, lockFocus question
- Subject: Re: NSSliderCell, lockFocus question
- From: Uli Kusterer <email@hidden>
- Date: Tue, 14 Apr 2009 09:55:21 +0200
On 14.04.2009, at 08:42, Frederik Slijkerman wrote:
I understand, but forking the code will hurt a lot, too. :-)
I never said fork. I meant get it refactored in a way that the code
that does the unneeded buffering is in a Windows-only class, while the
rest stays available.
OK, thanks, I try it. I'm basically looking for an equivalent to
Carbon's HITheme API, which allows you to draw theme-compliant
control parts yourself, and it looks like cells are the way to
achieve this with Cocoa. It's just that it isn't obvious how to get
it to work.
Be sure to file a bug, so Apple know you need HITheme-like
functionality going forward. It'll keep them aware that they should
either keep HITheme available, or make sure all NSCells they create/
change in the future retain the ability to be drawn into a context not
associated with any view. http://bugreport.apple.com is your friend.
Yep, I saw that it has a lockFocus call as well. Again, for the
existing code base it's much easier to be able to work with low-
level CG calls instead of Cocoa objects. Cocoa is a great way to do
things, but it's so different from other APIs (such as Carbon or
Win32) that it makes porting very hard...
If you say so. I don't see how NSImage wouldn't be the better choice
here (it automatically chooses the correct depth for your screens
etc.), but then I don't know the intricacies of your project. Do give
NSImage another thorough look, though. Many AppKit APIs are more high-
level, and thus more likely to automatically do the right thing no
matter what changes Apple make to the hardware. Also, higher-level
code can do some optimizations for you, while lower-level code forces
the machine into a certain code path that may be less efficient on one
or the other platform.
One more caveat: Drawing into a graphics buffer prevents OS X from
doing sub-pixel anti-aliasing. So, by adding this (unnecessary)
buffer, you might make your drawing look different than if you drew
into the system's buffer.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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