Settled the SetParent stuff. NOW we can test.
This commit is contained in:
parent
23c2998040
commit
3ca4a28bb3
|
@ -228,7 +228,8 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy)
|
||||||
[b->stretchy addObject:[NSNumber numberWithInt:stretchy]];
|
[b->stretchy addObject:[NSNumber numberWithInt:stretchy]];
|
||||||
|
|
||||||
uiControlSetParent(c, uiControl(b));
|
uiControlSetParent(c, uiControl(b));
|
||||||
[b->view addSubview:childView];
|
uiControlSetSuperview(c, b->view);
|
||||||
|
uiControlSyncEnableState(c, uiControlEnabledToUser(uiControl(b)));
|
||||||
|
|
||||||
// TODO save the old hugging priorities
|
// TODO save the old hugging priorities
|
||||||
// if a control is stretchy, it should not hug in the primary direction
|
// if a control is stretchy, it should not hug in the primary direction
|
||||||
|
|
|
@ -89,7 +89,8 @@ void uiGroupSetChild(uiGroup *g, uiControl *child)
|
||||||
// we have to add controls to the box itself NOT the content view
|
// we have to add controls to the box itself NOT the content view
|
||||||
// otherwise, things get really glitchy
|
// otherwise, things get really glitchy
|
||||||
// we also need to call -sizeToFit, but we'll do that in the relayout that's triggered below (see above)
|
// we also need to call -sizeToFit, but we'll do that in the relayout that's triggered below (see above)
|
||||||
[g->box addSubview:childView];
|
uiControlSetSuperview(c, g->box);
|
||||||
|
uiControlSyncEnableState(c, uiControlEnabledToUser(uiControl(g)));
|
||||||
}
|
}
|
||||||
groupRelayout(g);
|
groupRelayout(g);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,8 @@ void uiTabInsertAt(uiTab *t, const char *name, uintmax_t n, uiControl *child)
|
||||||
childView = (NSView *) uiControlHandle(child);
|
childView = (NSView *) uiControlHandle(child);
|
||||||
view = [[NSView alloc] initWithFrame:NSZeroRect];
|
view = [[NSView alloc] initWithFrame:NSZeroRect];
|
||||||
// TODO if we turn off the autoresizing mask, nothing shows up; didn't this get documented somewhere?
|
// TODO if we turn off the autoresizing mask, nothing shows up; didn't this get documented somewhere?
|
||||||
[view addSubview:childView];
|
uiControlSetSuperview(child, view);
|
||||||
|
uiControlSyncEnableState(child, uiControlEnabledToUser(uiControl(t)));
|
||||||
|
|
||||||
[t->pages insertObject:[NSValue valueWithPointer:child] atIndex:n];
|
[t->pages insertObject:[NSValue valueWithPointer:child] atIndex:n];
|
||||||
[t->views insertObject:view atIndex:n];
|
[t->views insertObject:view atIndex:n];
|
||||||
|
|
|
@ -187,7 +187,8 @@ void uiWindowSetChild(uiWindow *w, uiControl *child)
|
||||||
if (w->child != NULL) {
|
if (w->child != NULL) {
|
||||||
uiControlSetParent(w->child, uiControl(w));
|
uiControlSetParent(w->child, uiControl(w));
|
||||||
childView = (NSView *) uiControlHandle(w->child);
|
childView = (NSView *) uiControlHandle(w->child);
|
||||||
[[w->window contentView] addSubview:childView];
|
uiControlSetSuperview(child, [w->window contentView]);
|
||||||
|
uiControlSyncEnableState(child, uiControlEnabledToUser(uiControl(w)));
|
||||||
}
|
}
|
||||||
windowRelayout(w);
|
windowRelayout(w);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
every rule in ui_darwin.h
|
every rule in ui_darwin.h
|
||||||
SetParent must be followed by SetSuperview
|
SetParent must be followed by SetSuperview and SyncEnableState
|
||||||
TODO can child cache it?
|
TODO can child cache it?
|
||||||
adding a child must be followed by a call to SyncEnableState
|
adding a child must be followed by a call to SyncEnableState
|
||||||
|
|
Loading…
Reference in New Issue