Re: Control tints
Re: Control tints
- Subject: Re: Control tints
- From: Rainer Brockerhoff <email@hidden>
- Date: Wed, 30 Jan 2002 10:46:04 -0200
>
Date: Tue, 29 Jan 2002 18:23:34 -0800
>
From: email@hidden
>
>
I'm making a custom control in Cocoa, and I'd like it to look blue
>
when the system tint is blue, graphite when the system tint is
>
graphite. I've found the enumeration for tints and the "control tint
>
changed" notification in NSCell.h (funny place for it if you ask
>
me :->). However, I can't find any way anywhere to get the current
>
system control tint, to know which tint to use in drawing my control.
I call:
BOOL graphite;
CFStringRef str = nil;
CopyThemeIdentifier(&str);
graphite = CFStringCompare(str,kThemeAppearanceAquaGraphite,0)==kCFCompareEqualTo;
CFRelease(str);
and then draw blue or graphite images, depending on the BOOL.
I don't think you can get the specific tint; anyway, I tried converting the blue controls to grayscale and they don't come out exactly identical to the "real" graphite controls.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"I love deadlines. I love the whooshing noise they make as they go by" (Douglas Adams)
http://www.brockerhoff.net/ (updated Jan. 2002)