diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-10 13:28:15 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-10 13:28:34 -0400 |
| commit | 65db139be73ac03b4e7f2d0638727a4ff0e68005 (patch) | |
| tree | 76a4240893d063b765a1983391694eda1327a5fa /redo/control_darwin.m | |
| parent | 0b3f6570ace035802d5ec02a6862d6130f5440ec (diff) | |
More .m file restructuring on the Mac OS X backend.
Diffstat (limited to 'redo/control_darwin.m')
| -rw-r--r-- | redo/control_darwin.m | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/redo/control_darwin.m b/redo/control_darwin.m index f34f3c2..bc6dbe6 100644 --- a/redo/control_darwin.m +++ b/redo/control_darwin.m @@ -3,8 +3,30 @@ #import "objc_darwin.h" #import <Cocoa/Cocoa.h> -#define toNSControl(x) ((NSControl *) (x)) #define toNSView(x) ((NSView *) (x)) +#define toNSControl(x) ((NSControl *) (x)) + +void parent(id control, id parentid) +{ + [toNSView(parentid) addSubview:toNSView(control)]; +} + +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]]]; +} // also good for NSTableView (TODO might not do what we want) and NSProgressIndicator struct xsize controlPreferredSize(id control) |
