Fixed tabDelete() not properly preserving the child control.
This commit is contained in:
parent
4db24bff05
commit
c96fa44786
|
@ -180,7 +180,7 @@ static void tabDelete(uiTab *tt, uintmax_t n)
|
||||||
ptrArrayDelete(t->pages, n);
|
ptrArrayDelete(t->pages, n);
|
||||||
|
|
||||||
// and free the page
|
// and free the page
|
||||||
// this will keep the control alive
|
tabPagePreserveChild(page);
|
||||||
uiControlSetParent(page, NULL);
|
uiControlSetParent(page, NULL);
|
||||||
uiControlDestroy(page);
|
uiControlDestroy(page);
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,14 @@ void tabPageDestroyChild(uiControl *c)
|
||||||
t->child = NULL;
|
t->child = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tabPagePreserveChild(uiControl *c)
|
||||||
|
{
|
||||||
|
struct tabPage *t = (struct tabPage *) c;
|
||||||
|
|
||||||
|
uiControlSetParent(t->child, NULL);
|
||||||
|
t->child = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void tabPageSetChild(uiControl *c, uiControl *child)
|
void tabPageSetChild(uiControl *c, uiControl *child)
|
||||||
{
|
{
|
||||||
struct tabPage *t = (struct tabPage *) c;
|
struct tabPage *t = (struct tabPage *) c;
|
||||||
|
|
|
@ -119,4 +119,5 @@ extern uiControl *newTabPage(void);
|
||||||
extern int tabPageMargined(uiControl *);
|
extern int tabPageMargined(uiControl *);
|
||||||
extern void tabPageSetMargined(uiControl *, int);
|
extern void tabPageSetMargined(uiControl *, int);
|
||||||
extern void tabPageDestroyChild(uiControl *);
|
extern void tabPageDestroyChild(uiControl *);
|
||||||
|
extern void tabPagePreserveChild(uiControl *);
|
||||||
extern void tabPageSetChild(uiControl *, uiControl *);
|
extern void tabPageSetChild(uiControl *, uiControl *);
|
||||||
|
|
Loading…
Reference in New Issue