diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-09 21:34:56 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-09 21:34:56 -0400 |
| commit | 62938635a2a6c5d614a890131483c57e1482d1fd (patch) | |
| tree | 01fd66f1ff5e3506b7300663fb80690cc71b0c59 /redo/control_darwin.m | |
| parent | ea3dd093f7941cfc74af085fffc8e3f24b2ce0d5 (diff) | |
Started splitting apart xsizing_darwin.m and rearranging objc_darwin.h.
Diffstat (limited to 'redo/control_darwin.m')
| -rw-r--r-- | redo/control_darwin.m | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/redo/control_darwin.m b/redo/control_darwin.m index a939583..f34f3c2 100644 --- a/redo/control_darwin.m +++ b/redo/control_darwin.m @@ -3,9 +3,26 @@ #import "objc_darwin.h" #import <Cocoa/Cocoa.h> +#define toNSControl(x) ((NSControl *) (x)) #define toNSView(x) ((NSView *) (x)) +// also good for NSTableView (TODO might not do what we want) and NSProgressIndicator +struct xsize controlPreferredSize(id control) +{ + NSControl *c; + NSRect r; + struct xsize s; + + c = toNSControl(control); + [c sizeToFit]; + r = [c frame]; + s.width = (intptr_t) r.size.width; + s.height = (intptr_t) r.size.height; + return s; +} + // TODO verify this when we add more scrolling controls +// TODO no borders on Area id newScrollView(id content) { NSScrollView *sv; |
