Made the necessary previous commits changes on the Mac OS X backend. Untested yet.

This commit is contained in:
Pietro Gagliardi 2015-04-14 12:51:20 -04:00
parent 025b9f576b
commit fff86431e3
1 changed files with 10 additions and 14 deletions

View File

@ -32,22 +32,19 @@ static void singleSetParent(uiControl *c, uiParent *parent)
{ {
singleView *s = (singleView *) (c->internal); singleView *s = (singleView *) (c->internal);
NSView *parentView; NSView *parentView;
s->parent = parent;
parentView = (NSView *) uiParentHandle(s->parent);
[parentView addSubview:s->immediate];
uiParentUpdate(s->parent);
}
static void singleRemoveParent(uiControl *c)
{
singleView *s = (singleView *) (c->internal);
uiParent *oldparent; uiParent *oldparent;
oldparent = s->parent; oldparent = s->parent;
s->parent = NULL; s->parent = parent;
[s->immediate removeFromSuperview]; if (oldparent != NULL) {
uiParentUpdate(oldparent); [s->immediate removeFromSuperview];
uiParentUpdate(oldparent);
}
if (s->parent != NULL) {
parentView = (NSView *) uiParentHandle(s->parent);
[parentView addSubview:s->immediate];
uiParentUpdate(s->parent);
}
} }
// also good for NSBox and NSProgressIndicator // also good for NSBox and NSProgressIndicator
@ -209,7 +206,6 @@ uiControl *uiDarwinNewControl(Class class, BOOL inScrollView, BOOL scrollViewHas
c->destroy = singleDestroy; c->destroy = singleDestroy;
c->handle = singleHandle; c->handle = singleHandle;
c->setParent = singleSetParent; c->setParent = singleSetParent;
c->removeParent = singleRemoveParent;
c->preferredSize = singlePreferredSize; c->preferredSize = singlePreferredSize;
c->resize = singleResize; c->resize = singleResize;
c->visible = singleVisible; c->visible = singleVisible;