From 351c7cd9b2fd11a69b2df469f6c99e30c691a0f1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 18 Jul 2014 11:47:48 -0400 Subject: [PATCH] Added the standard control fonts to the Mac OS X backend. The GTK+ backend is fine as it stands. --- redo/controls_darwin.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/redo/controls_darwin.m b/redo/controls_darwin.m index d8e0e51..f7554f5 100644 --- a/redo/controls_darwin.m +++ b/redo/controls_darwin.m @@ -6,6 +6,7 @@ #define toNSView(x) ((NSView *) (x)) #define toNSWindow(x) ((NSWindow *) (x)) +#define toNSControl(x) ((NSControl *) (x)) #define toNSButton(x) ((NSButton *) (x)) void unparent(id control) @@ -22,6 +23,11 @@ void parent(id control, id parentid, BOOL floating) [toNSView(control) release]; } +static inline void setStandardControlFont(id control) +{ + [toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]]; +} + @interface goControlDelegate : NSObject { @public void *gocontrol; @@ -48,6 +54,7 @@ id newButton(char *text) [b setTitle:[NSString stringWithUTF8String:text]]; [b setBordered:YES]; [b setBezelStyle:NSRoundedBezelStyle]; + setStandardControlFont(b); return b; }