diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-02 08:04:44 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-02 08:04:44 -0400 |
| commit | 85fb097ab97603ff2539ec7a3abd6ae8b96a44cb (patch) | |
| tree | 7b586ebffdd7a03ce504c4b687a23ddec2bd13aa /redo/xsizing_darwin.m | |
| parent | 37cf0a20c06d457755f209d3fc393f9593c534af (diff) | |
Wrote Control.preferredSize() (including Tab.preferredSize()) on Mac OS X.
Diffstat (limited to 'redo/xsizing_darwin.m')
| -rw-r--r-- | redo/xsizing_darwin.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/redo/xsizing_darwin.m b/redo/xsizing_darwin.m index 12faf4b..6ad95f0 100644 --- a/redo/xsizing_darwin.m +++ b/redo/xsizing_darwin.m @@ -4,6 +4,7 @@ #import <Cocoa/Cocoa.h> #define toNSControl(x) ((NSControl *) (x)) +#define toNSTabView(x) ((NSTabView *) (x)) #define toNSScrollView(x) ((NSScrollView *) (x)) #define toNSView(x) ((NSView *) (x)) @@ -24,6 +25,19 @@ struct xsize controlPrefSize(id control) return s; } +struct xsize tabPrefSize(id control) +{ + NSTabView *tv; + NSSize s; + struct xsize t; + + tv = toNSTabView(control); + s = [tv minimumSize]; + t.width = (intptr_t) s.width; + t.height = (intptr_t) s.height; + return t; +} + // TODO use this, possibly update to not need scrollview /* struct xsize areaPrefSize(id scrollview) |
