diff --git a/redo/basicctrls_darwin.m b/redo/basicctrls_darwin.m index c482e5e..5ed17c1 100644 --- a/redo/basicctrls_darwin.m +++ b/redo/basicctrls_darwin.m @@ -10,6 +10,8 @@ #define toNSButton(x) ((NSButton *) (x)) #define toNSTextField(x) ((NSTextField *) (x)) +// TODO move to control_darwin.m + void parent(id control, id parentid) { [toNSView(parentid) addSubview:toNSView(control)]; @@ -20,11 +22,18 @@ void controlSetHidden(id control, BOOL hidden) [toNSView(control) setHidden:hidden]; } +// also fine for NSCells void setStandardControlFont(id control) { [toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]]; } +// also fine for NSCells +void setSmallControlFont(id control) +{ + [toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]]]; +} + @interface goControlDelegate : NSObject { @public void *gocontrol; diff --git a/redo/objc_darwin.h b/redo/objc_darwin.h index 05d6d40..59c98fc 100644 --- a/redo/objc_darwin.h +++ b/redo/objc_darwin.h @@ -35,6 +35,7 @@ extern void windowRedraw(id); extern void parent(id, id); extern void controlSetHidden(id, BOOL); extern void setStandardControlFont(id); +extern void setSmallControlFont(id); extern id newButton(void); extern void buttonSetDelegate(id, void *); extern const char *buttonText(id); diff --git a/redo/table_darwin.m b/redo/table_darwin.m index 1e823b4..8bb7e0f 100644 --- a/redo/table_darwin.m +++ b/redo/table_darwin.m @@ -45,12 +45,10 @@ id newTable(void) [t setAllowsMultipleSelection:NO]; [t setAllowsEmptySelection:YES]; [t setAllowsColumnSelection:NO]; - // TODO check against interface builder return (id) t; } -// TODO scroll view - +// TODO other types void tableAppendColumn(id t, char *name) { NSTableColumn *c; @@ -58,7 +56,9 @@ void tableAppendColumn(id t, char *name) c = [[NSTableColumn alloc] initWithIdentifier:nil]; [c setEditable:NO]; [[c headerCell] setStringValue:[NSString stringWithUTF8String:name]]; - // TODO other options + setSmallControlFont((id) [c headerCell]); + setStandardControlFont((id) [c dataCell]); + // TODO text layout options [toNSTableView(t) addTableColumn:c]; }