Fixed most runtime issues.
This commit is contained in:
parent
89b47316f9
commit
8ba1ed9960
|
@ -65,6 +65,7 @@ void uiBoxAppend(uiBox *b, uiControl *c, int stretchy)
|
|||
bc->c = c;
|
||||
bc->stretchy = stretchy;
|
||||
uiControlSetParent(bc->c, uiControl(b));
|
||||
gtk_container_add(b->container, GTK_WIDGET(uiControlHandle(bc->c)));
|
||||
widget = GTK_WIDGET(uiControlHandle(bc->c));
|
||||
if (bc->stretchy) {
|
||||
if (b->vertical) {
|
||||
|
@ -93,6 +94,7 @@ void uiBoxDelete(uiBox *b, uintmax_t index)
|
|||
ptrArrayDelete(b->controls, index);
|
||||
if (bc->stretchy)
|
||||
gtk_size_group_remove_widget(b->stretchygroup, GTK_WIDGET(uiControlHandle(bc->c)));
|
||||
gtk_container_remove(b->container, GTK_WIDGET(uiControlHandle(bc->c)));
|
||||
uiControlSetParent(bc->c, NULL);
|
||||
uiFree(bc);
|
||||
uiControlQueueResize(uiControl(b));
|
||||
|
|
|
@ -162,9 +162,12 @@ static uiMenuItem *newItem(uiMenu *m, int type, const char *name)
|
|||
break;
|
||||
}
|
||||
|
||||
uiMenuItemOnClicked(item, defaultOnClicked, NULL);
|
||||
if (item->type == typeQuit)
|
||||
uiMenuItemOnClicked(item, onQuitClicked, NULL);
|
||||
if (item->type == typeQuit) {
|
||||
// can't call uiMenuItemOnClicked() here
|
||||
item->onClicked = onQuitClicked;
|
||||
item->onClickedData = NULL;
|
||||
} else
|
||||
uiMenuItemOnClicked(item, defaultOnClicked, NULL);
|
||||
|
||||
switch (item->type) {
|
||||
case typeCheckbox:
|
||||
|
|
|
@ -56,6 +56,7 @@ void uiTabInsertAt(uiTab *t, const char *name, uintmax_t n, uiControl *child)
|
|||
page.box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add(GTK_CONTAINER(page.box),
|
||||
GTK_WIDGET(uiControlHandle(page.c)));
|
||||
gtk_widget_show(page.box);
|
||||
|
||||
gtk_container_add(t->container, page.box);
|
||||
gtk_notebook_set_tab_label_text(t->notebook, page.box, name);
|
||||
|
|
|
@ -51,8 +51,10 @@ static void onDestroy(uiWindow *w)
|
|||
// first hide ourselves
|
||||
gtk_widget_hide(w->widget);
|
||||
// now destroy the child
|
||||
uiControlSetParent(w->child, NULL);
|
||||
uiControlDestroy(w->child);
|
||||
if (w->child != NULL) {
|
||||
uiControlSetParent(w->child, NULL);
|
||||
uiControlDestroy(w->child);
|
||||
}
|
||||
// now destroy the menus, if any
|
||||
if (w->menubar != NULL)
|
||||
freeMenubar(w->menubar);
|
||||
|
@ -151,6 +153,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
|||
gtk_widget_set_vexpand(w->childbox, TRUE);
|
||||
gtk_widget_set_valign(w->childbox, GTK_ALIGN_FILL);
|
||||
gtk_container_add(w->vboxContainer, w->childbox);
|
||||
gtk_widget_show(w->childbox);
|
||||
|
||||
// show everything in the vbox, but not the GtkWindow itself
|
||||
gtk_widget_show_all(w->vboxWidget);
|
||||
|
|
Loading…
Reference in New Issue