Fixed build errors. It works!

This commit is contained in:
Pietro Gagliardi 2015-04-29 10:17:49 -04:00
parent 9f59c0059c
commit 1288624725
3 changed files with 7 additions and 7 deletions

View File

@ -8,6 +8,7 @@ osMFILES = \
darwin/main.m \ darwin/main.m \
darwin/menu.m \ darwin/menu.m \
darwin/newcontrol.m \ darwin/newcontrol.m \
darwin/tab.m \
darwin/text.m \ darwin/text.m \
darwin/util.m \ darwin/util.m \
darwin/window.m darwin/window.m

View File

@ -21,7 +21,6 @@ static void singleDestroy(uiControl *c)
complain("attempt to destroy a uiControl at %p while it still has a parent", c); complain("attempt to destroy a uiControl at %p while it still has a parent", c);
[s->immediate retain]; // to keep alive when removing [s->immediate retain]; // to keep alive when removing
(*(s->onDestroy))(s->onDestroyData); (*(s->onDestroy))(s->onDestroyData);
[destroyedControlsView addSubview:s->immediate];
[s->immediate release]; [s->immediate release];
} }
@ -33,24 +32,24 @@ static uintptr_t singleHandle(uiControl *c)
} }
// TODO update refcounting here and in the GTK+ port // TODO update refcounting here and in the GTK+ port
static void singleSetParent(uiControl *c, uiParent *parent) static void singleSetParent(uiControl *c, uiContainer *parent)
{ {
singleView *s = (singleView *) (c->Internal); singleView *s = (singleView *) (c->Internal);
NSView *parentView; NSView *parentView;
uiParent *oldparent; uiContainer *oldparent;
oldparent = s->parent; oldparent = s->parent;
s->parent = parent; s->parent = parent;
if (oldparent != NULL) if (oldparent != NULL)
[s->immediate removeFromSuperview]; [s->immediate removeFromSuperview];
if (s->parent != NULL) { if (s->parent != NULL) {
parentView = (NSView *) uiControlHandle(uiControls->parent)); parentView = (NSView *) uiControlHandle(uiControl(s->parent));
[parentView addSubview:s->immediate]; [parentView addSubview:s->immediate];
} }
if (oldparent != NULL) if (oldparent != NULL)
uiContainerUpdate(oldparent); uiContainerUpdate(oldparent);
if (s->parent != NULL) if (s->parent != NULL)
uiParentUpdate(s->parent); uiContainerUpdate(s->parent);
} }
// also good for NSBox and NSProgressIndicator // also good for NSBox and NSProgressIndicator

View File

@ -45,12 +45,12 @@ static void tabAppendPage(uiTab *tt, const char *name, uiControl *child)
NSTabViewItem *i; NSTabViewItem *i;
page = newBin(); page = newBin();
binSetMainConotrol(page, child); binSetMainControl(page, child);
[t->pages addObject:[NSValue valueWithPointer:page]]; [t->pages addObject:[NSValue valueWithPointer:page]];
i = [[NSTabViewItem alloc] initWithIdentifier:nil]; i = [[NSTabViewItem alloc] initWithIdentifier:nil];
[i setLabel:toNSString(name)]; [i setLabel:toNSString(name)];
[i setView:((NSView *) uiContainerHandle(content))]; [i setView:((NSView *) uiControlHandle(uiControl(page)))];
[t->tabview addTabViewItem:i]; [t->tabview addTabViewItem:i];
} }