Implemented uiControlDestroy() for uiRadioButtons on GTK+. Fixes #40.

This commit is contained in:
Pietro Gagliardi 2016-05-21 22:42:55 -04:00
parent 5891b764cb
commit 1c2acf59a3
1 changed files with 11 additions and 1 deletions

View File

@ -15,7 +15,17 @@ uiUnixControlAllDefaultsExceptDestroy(uiRadioButtons)
static void uiRadioButtonsDestroy(uiControl *c)
{
// TODO
uiRadioButtons *r = uiRadioButtons(c);
GtkWidget *b;
while (r->buttons->len != 0) {
b = GTK_WIDGET(g_ptr_array_remove_index(r->buttons, 0));
gtk_widget_destroy(b);
}
g_ptr_array_free(r->buttons, TRUE);
// and free ourselves
g_object_unref(r->widget);
uiFreeControl(uiControl(r));
}
void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)