From 963feb6c0668b3c64242607fe71f458420a91f32 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 13 Apr 2015 12:53:05 -0400 Subject: Converted and fixed the Mac OS X code for uiParent. I'm still not happy, but this is DEFINITELY a step in the right direction... Perhaps automatic deletion is a pipe dream :/ I should also really nail the parenting/unparenting logic, but for that I need to add one more method. --- new/tab_darwin.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'new/tab_darwin.m') diff --git a/new/tab_darwin.m b/new/tab_darwin.m index 4e835b3..c36181e 100644 --- a/new/tab_darwin.m +++ b/new/tab_darwin.m @@ -13,6 +13,7 @@ - (void)viewDidMoveToSuperview { + // TODO free all tabs explicitly if (uiDarwinControlFreeWhenAppropriate(self.uiC, [self superview])) self.uiC = NULL; [super viewDidMoveToSuperview]; @@ -52,16 +53,15 @@ uiControl *uiNewTab(void) void uiTabAddPage(uiControl *c, const char *name, uiControl *child) { uiNSTabView *tv; - uiContainer *container; + uiParent *content; NSTabViewItem *i; - container = [[uiContainer alloc] initWithFrame:NSZeroRect]; - container.uiChild = child; - uiControlSetParent(container.uiChild, (uintptr_t) container); + content = uiNewParent(0); + uiParentSetChild(content, child); i = [[NSTabViewItem alloc] initWithIdentifier:nil]; [i setLabel:toNSString(name)]; - [i setView:container]; + [i setView:((NSView *) uiParentHandle(content))]; tv = (uiNSTabView *) uiControlHandle(c); [tv addTabViewItem:i]; } -- cgit v1.2.3