summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2003-07-03 18:47:02 (GMT)
committerwolfsuit <wolfsuit>2003-07-03 18:47:02 (GMT)
commit1efd22b091f8908cded939bc3ba75ab14019299b (patch)
tree79e896d426ae9b147364523fbaf628061d948ba9
parent5b06984eeb5aa8c6e7a8b6f859b3c6964ee46237 (diff)
downloadtk-1efd22b091f8908cded939bc3ba75ab14019299b.zip
tk-1efd22b091f8908cded939bc3ba75ab14019299b.tar.gz
tk-1efd22b091f8908cded939bc3ba75ab14019299b.tar.bz2
Prime the systemButtonText from the theme brush. This is really only the first
stage of actually using the theme brushes to track active colors, but it gets the labelframe color working at least.
-rw-r--r--ChangeLog6
-rw-r--r--macosx/tkMacOSXColor.c36
2 files changed, 23 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d53d20..2e264fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-07-03 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXColor.c (GetControlPartColor): Use
+ the ThemeBrushes to get the control text color for
+ buttons.
+
2003-07-02 Mo DeJong <mdejong@users.sourceforge.net>
* unix/tkUnixEvent.c (TkpCloseDisplay): Don't
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 492f098..fb4017c 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXColor.c,v 1.2 2002/08/31 06:12:29 das Exp $
+ * RCS: @(#) $Id: tkMacOSXColor.c,v 1.3 2003/07/03 18:47:03 wolfsuit Exp $
*/
#include <tkColor.h>
@@ -330,8 +330,9 @@ TkpGetColorByValue(
* GetControlPartColor --
*
* Given a part number this function will return the standard
- * system default color for that part. It does this by looking
- * in the system's 'cctb' resource.
+ * system default color for that part. On MacOS X this uses the
+ * Theme Brushes to find the active color, though for now, only
+ * the "Text Color" is supported.
*
* Results:
* True if a color is found, false otherwise.
@@ -348,24 +349,21 @@ GetControlPartColor(
short part, /* Part code. */
RGBColor *macColor) /* Pointer to Mac color. */
{
-/* Stubbed out for OS X
- short index;
- CCTabHandle ccTab;
-
- if (defaultAuxCtlHandle == NULL) {
- GetAuxiliaryControlRecord(NULL, &defaultAuxCtlHandle);
- }
- ccTab = (**defaultAuxCtlHandle).acCTable;
- if(ccTab && (ResError() == noErr)) {
- for(index = 0; index <= (**ccTab).ctSize; index++) {
- if((**ccTab).ctTable[index].value == part) {
- *macColor = (**ccTab).ctTable[index].rgb;
- return true;
+ int retVal = false;
+ OSErr err;
+
+ switch (part) {
+ case cTextColor:
+ err = GetThemeTextColor(kThemeTextColorPushButtonActive, 32,
+ true, macColor);
+ if (err == noErr) {
+ retVal = true;
}
- }
+ break;
+ default:
+ retVal = false;
}
-*/
- return false;
+ return retVal;
}
/*