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->c = c;
|
||||||
bc->stretchy = stretchy;
|
bc->stretchy = stretchy;
|
||||||
uiControlSetParent(bc->c, uiControl(b));
|
uiControlSetParent(bc->c, uiControl(b));
|
||||||
|
gtk_container_add(b->container, GTK_WIDGET(uiControlHandle(bc->c)));
|
||||||
widget = GTK_WIDGET(uiControlHandle(bc->c));
|
widget = GTK_WIDGET(uiControlHandle(bc->c));
|
||||||
if (bc->stretchy) {
|
if (bc->stretchy) {
|
||||||
if (b->vertical) {
|
if (b->vertical) {
|
||||||
|
@ -93,6 +94,7 @@ void uiBoxDelete(uiBox *b, uintmax_t index)
|
||||||
ptrArrayDelete(b->controls, index);
|
ptrArrayDelete(b->controls, index);
|
||||||
if (bc->stretchy)
|
if (bc->stretchy)
|
||||||
gtk_size_group_remove_widget(b->stretchygroup, GTK_WIDGET(uiControlHandle(bc->c)));
|
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);
|
uiControlSetParent(bc->c, NULL);
|
||||||
uiFree(bc);
|
uiFree(bc);
|
||||||
uiControlQueueResize(uiControl(b));
|
uiControlQueueResize(uiControl(b));
|
||||||
|
|
|
@ -162,9 +162,12 @@ static uiMenuItem *newItem(uiMenu *m, int type, const char *name)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uiMenuItemOnClicked(item, defaultOnClicked, NULL);
|
if (item->type == typeQuit) {
|
||||||
if (item->type == typeQuit)
|
// can't call uiMenuItemOnClicked() here
|
||||||
uiMenuItemOnClicked(item, onQuitClicked, NULL);
|
item->onClicked = onQuitClicked;
|
||||||
|
item->onClickedData = NULL;
|
||||||
|
} else
|
||||||
|
uiMenuItemOnClicked(item, defaultOnClicked, NULL);
|
||||||
|
|
||||||
switch (item->type) {
|
switch (item->type) {
|
||||||
case typeCheckbox:
|
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);
|
page.box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
|
||||||
gtk_container_add(GTK_CONTAINER(page.box),
|
gtk_container_add(GTK_CONTAINER(page.box),
|
||||||
GTK_WIDGET(uiControlHandle(page.c)));
|
GTK_WIDGET(uiControlHandle(page.c)));
|
||||||
|
gtk_widget_show(page.box);
|
||||||
|
|
||||||
gtk_container_add(t->container, page.box);
|
gtk_container_add(t->container, page.box);
|
||||||
gtk_notebook_set_tab_label_text(t->notebook, page.box, name);
|
gtk_notebook_set_tab_label_text(t->notebook, page.box, name);
|
||||||
|
|
|
@ -51,8 +51,10 @@ static void onDestroy(uiWindow *w)
|
||||||
// first hide ourselves
|
// first hide ourselves
|
||||||
gtk_widget_hide(w->widget);
|
gtk_widget_hide(w->widget);
|
||||||
// now destroy the child
|
// now destroy the child
|
||||||
uiControlSetParent(w->child, NULL);
|
if (w->child != NULL) {
|
||||||
uiControlDestroy(w->child);
|
uiControlSetParent(w->child, NULL);
|
||||||
|
uiControlDestroy(w->child);
|
||||||
|
}
|
||||||
// now destroy the menus, if any
|
// now destroy the menus, if any
|
||||||
if (w->menubar != NULL)
|
if (w->menubar != NULL)
|
||||||
freeMenubar(w->menubar);
|
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_vexpand(w->childbox, TRUE);
|
||||||
gtk_widget_set_valign(w->childbox, GTK_ALIGN_FILL);
|
gtk_widget_set_valign(w->childbox, GTK_ALIGN_FILL);
|
||||||
gtk_container_add(w->vboxContainer, w->childbox);
|
gtk_container_add(w->vboxContainer, w->childbox);
|
||||||
|
gtk_widget_show(w->childbox);
|
||||||
|
|
||||||
// show everything in the vbox, but not the GtkWindow itself
|
// show everything in the vbox, but not the GtkWindow itself
|
||||||
gtk_widget_show_all(w->vboxWidget);
|
gtk_widget_show_all(w->vboxWidget);
|
||||||
|
|
Loading…
Reference in New Issue