changeset 673:6d0f0dc7ff7c

Some minor font fixes.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 27 Feb 2011 21:00:02 +0000
parents 388f2a48aaae
children 78f9aa6d6d89
files mac/dw.m
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Sun Feb 27 19:25:21 2011 +0000
+++ b/mac/dw.m	Sun Feb 27 21:00:02 2011 +0000
@@ -2714,7 +2714,9 @@
 	NSTextField *textfield = dw_text_new(text, id);
 	[textfield setBordered:YES];
 	[textfield setBezeled:YES];
-	[textfield setBezelStyle:NSRecessedBezelStyle];
+	[textfield setBezelStyle:NSTextFieldSquareBezel];
+    [textfield setBackgroundColor:[NSColor colorWithDeviceRed:1 green:1 blue:1 alpha: 0]];
+    [textfield setDrawsBackground:NO];
 	return textfield;
 }
 
@@ -4654,10 +4656,17 @@
 		*name = 0;
 		name++;
 		NSFont *font = [NSFont fontWithName:[ NSString stringWithUTF8String:name ] size:(float)size];
-		id object = handle;
-		[object lockFocus];
-		[font set];
-		[object unlockFocus];		
+        if(font)
+        {
+            id object = handle;
+            if([object window])
+            {
+                [object lockFocus];
+                [font set];
+                [object unlockFocus];
+            }
+            [object setFont:font];
+        }
 	}
 	free(fontcopy);
 	return 0;