summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXColor.c12
-rw-r--r--macosx/tkMacOSXColor.h2
-rw-r--r--macosx/tkMacOSXMenu.c4
3 files changed, 16 insertions, 2 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index e65bf35..b5b0e4b 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -35,6 +35,7 @@ static CGFloat windowBackground[4] =
void initColorTable()
{
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
Tcl_InitHashTable(&systemColors, TCL_STRING_KEYS);
SystemColorDatum *entry, *oldEntry;
Tcl_HashSearch search;
@@ -86,7 +87,7 @@ void initColorTable()
/*
* Add all of the colors in the System ColorList.
*/
-
+
for (key in [systemColorList allKeys]) {
int length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
char *name;
@@ -95,6 +96,14 @@ void initColorTable()
name = ckalloc(length + 1);
strcpy(name, key.UTF8String);
name[0] = toupper(name[0]);
+ if (!strcmp(name, "WindowBackgroundColor")) {
+
+ /*
+ * Avoid black windows on old systems.
+ */
+
+ continue;
+ }
entry->type=semantic;
entry->name = name;
entry->selector = [key retain];
@@ -134,6 +143,7 @@ void initColorTable()
hPtr = Tcl_FindHashEntry(&systemColors, "ControlAccentColor");
entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr);
controlAccentIndex = entry->index;
+ [pool drain];
}
/*
diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h
index da62955..0ff7aee 100644
--- a/macosx/tkMacOSXColor.h
+++ b/macosx/tkMacOSXColor.h
@@ -248,6 +248,8 @@ static SystemColorDatum systemColorData[] = {
{"SelectedTabTextColor", semantic, 0, "blackColor", 0, NULL },
#endif
/* Semantic colors that we simulate on older systems which don't supoort them. */
+{"ControlAccentColor", semantic, 0, "controlAccentColor", 0, NULL },
+{"LabelColor", semantic, 0, "blackColor", 0, NULL },
{"LinkColor", semantic, 0, "blueColor", 0, NULL },
{"PlaceholderTextColor", semantic, 0, "grayColor", 0, NULL },
{"SeparatorColor", semantic, 0, "grayColor", 0, NULL },
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 379e25c..a77ea59 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -139,6 +139,7 @@ static int ModifierCharWidth(Tk_Font tkfont);
@implementation TKBackgroundLoop
- (void) main
{
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSArray *modeArray = [NSArray arrayWithObjects: NSEventTrackingRunLoopMode,
nil];
while(1) {
@@ -151,7 +152,7 @@ static int ModifierCharWidth(Tk_Font tkfont);
withObject:nil
waitUntilDone:true
modes:modeArray];
- if (self.cancelled) {
+ if ([self isCancelled]) {
[NSThread exit];
}
@@ -161,6 +162,7 @@ static int ModifierCharWidth(Tk_Font tkfont);
[NSThread sleepForTimeInterval:0.001];
}
+ [pool drain];
}
@end