diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-25 23:11:41 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-25 23:11:41 -0400 |
| commit | ee5c6ff8461d5147fa74205f21b7fce6e5606d74 (patch) | |
| tree | 942d428fd6ceacececeb6ca23d50206f59abdd15 /redo/containers_darwin.m | |
| parent | 41f3ef292f2e0d70beb3722004c968881ca0fae2 (diff) | |
Implemented Tab on Mac OS X. Woo! I'll need to add justification for what I'm doing with the whole recursive call thing; when I get confirmation from the GTK+ camp I will.
Diffstat (limited to 'redo/containers_darwin.m')
| -rw-r--r-- | redo/containers_darwin.m | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/redo/containers_darwin.m b/redo/containers_darwin.m new file mode 100644 index 0000000..0d3c33e --- /dev/null +++ b/redo/containers_darwin.m @@ -0,0 +1,46 @@ +// 25 july 2014 + +#import "objc_darwin.h" +#import "_cgo_export.h" +#import <Cocoa/Cocoa.h> + +#define toNSTabView(x) ((NSTabView *) (x)) + +@interface goTabView : NSTabView { +@public + void *gotab; +} +@end + +@implementation goTabView + +- (void)setFrame:(NSRect)r +{ + NSRect content; + + [super setFrame:r]; + content = [self contentRect]; + tabResized(self->gotab, (intptr_t) content.size.width, (intptr_t) content.size.height); +} + +@end + +id newTab(void *gotab) +{ + goTabView *t; + + t = [[goTabView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; + // TODO font + t->gotab = gotab; + return (id) t; +} + +id tabAppend(id t, char *name) +{ + NSTabViewItem *i; + + i = [[NSTabViewItem alloc] initWithIdentifier:nil]; + [i setLabel:[NSString stringWithUTF8String:name]]; + [toNSTabView(t) addTabViewItem:i]; + return (id) [i view]; +} |
