Fixed build errors. It works! (Except for radiobuttons now needing a destroy; that'll come later.) Next up... Windows. Yay...

This commit is contained in:
Pietro Gagliardi 2016-04-25 20:34:12 -04:00
parent d65a263bb4
commit 4e11b6efe1
8 changed files with 3 additions and 14 deletions

View File

@ -521,8 +521,6 @@ uiArea *uiNewArea(uiAreaHandler *ah)
a->widget = a->areaWidget; a->widget = a->areaWidget;
uiUnixFinishNewControl(a, uiArea);
return a; return a;
} }
@ -553,7 +551,5 @@ uiArea *uiNewScrollingArea(uiAreaHandler *ah, intmax_t width, intmax_t height)
// and make the area visible; only the scrolled window's visibility is controlled by libui // and make the area visible; only the scrolled window's visibility is controlled by libui
gtk_widget_show(a->areaWidget); gtk_widget_show(a->areaWidget);
uiUnixFinishNewControl(a, uiArea);
return a; return a;
} }

View File

@ -31,8 +31,6 @@ char *uiButtonText(uiButton *b)
void uiButtonSetText(uiButton *b, const char *text) void uiButtonSetText(uiButton *b, const char *text)
{ {
gtk_button_set_label(b->button, text); gtk_button_set_label(b->button, text);
// changing the text might necessitate a change in the button's size
uiControlQueueResize(uiControl(b));
} }
void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data) void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *, void *), void *data)

View File

@ -34,8 +34,6 @@ char *uiCheckboxText(uiCheckbox *c)
void uiCheckboxSetText(uiCheckbox *c, const char *text) void uiCheckboxSetText(uiCheckbox *c, const char *text)
{ {
gtk_button_set_label(GTK_BUTTON(c->button), text); gtk_button_set_label(GTK_BUTTON(c->button), text);
// changing the text might necessitate a change in the checkbox's size
uiControlQueueResize(uiControl(c));
} }
void uiCheckboxOnToggled(uiCheckbox *c, void (*f)(uiCheckbox *, void *), void *data) void uiCheckboxOnToggled(uiCheckbox *c, void (*f)(uiCheckbox *, void *), void *data)

View File

@ -73,7 +73,7 @@ void childRemove(struct child *c)
{ {
uiControlSetParent(c->c, NULL); uiControlSetParent(c->c, NULL);
// TODO safe with boxes? // TODO safe with boxes?
uiUnixControlSetContainer(uiUnixControl(c->c), parentContainer, TRUE); uiUnixControlSetContainer(uiUnixControl(c->c), c->parent, TRUE);
gtk_widget_set_hexpand(c->widget, c->oldhexpand); gtk_widget_set_hexpand(c->widget, c->oldhexpand);
gtk_widget_set_halign(c->widget, c->oldhalign); gtk_widget_set_halign(c->widget, c->oldhalign);

View File

@ -8,7 +8,7 @@ void uiUnixControlSetContainer(uiUnixControl *c, GtkContainer *container, gboole
#define uiUnixControlSignature 0x556E6978 #define uiUnixControlSignature 0x556E6978
uiUnixControl *uiUnixNewControl(size_t n, uint32_t typesig, const char *typenamestr) uiUnixControl *uiUnixAllocControl(size_t n, uint32_t typesig, const char *typenamestr)
{ {
return uiUnixControl(uiAllocControl(n, uiUnixControlSignature, typesig, typenamestr)); return uiUnixControl(uiAllocControl(n, uiUnixControlSignature, typesig, typenamestr));
} }

View File

@ -18,8 +18,6 @@ char *uiLabelText(uiLabel *l)
void uiLabelSetText(uiLabel *l, const char *text) void uiLabelSetText(uiLabel *l, const char *text)
{ {
gtk_label_set_text(l->label, text); gtk_label_set_text(l->label, text);
// changing the text might necessitate a change in the label's size
uiControlQueueResize(uiControl(l));
} }
uiLabel *uiNewLabel(const char *text) uiLabel *uiNewLabel(const char *text)

View File

@ -30,7 +30,6 @@ void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)
gtk_container_add(r->container, rb); gtk_container_add(r->container, rb);
g_ptr_array_add(r->buttons, rb); g_ptr_array_add(r->buttons, rb);
gtk_widget_show(rb); gtk_widget_show(rb);
uiControlQueueResize(uiControl(r));
} }
uiRadioButtons *uiNewRadioButtons(void) uiRadioButtons *uiNewRadioButtons(void)

View File

@ -26,7 +26,7 @@ static void uiTabDestroy(uiControl *c)
g_array_free(t->pages, TRUE); g_array_free(t->pages, TRUE);
// and free ourselves // and free ourselves
g_object_unref(t->widget); g_object_unref(t->widget);
uiControlFree(uiControl(t)); uiFreeControl(uiControl(t));
} }
void uiTabAppend(uiTab *t, const char *name, uiControl *child) void uiTabAppend(uiTab *t, const char *name, uiControl *child)