static void uiMultilineEntryDestroy(uiControl *c) { uiMultilineEntry *e = uiMultilineEntry(c); uiWindowsUnregisterWM_COMMANDHandler(e->hwnd); uiWindowsEnsureDestroyWindow(e->hwnd); uiFreeControl(uiControl(e)); }
static void uiImageBoxDestroy(uiControl *c) { uiImageBox *b = uiImageBox(c); uiImageBoxSetImage(b, NULL); uiWindowsEnsureDestroyWindow(b->hwnd); uiFreeControl(uiControl(b)); }
void uiEditableComboboxDestroy(uiControl *cc) { uiEditableCombobox *c = uiEditableCombobox(cc); uiWindowsUnregisterWM_COMMANDHandler(c->hwnd); uiWindowsEnsureDestroyWindow(c->hwnd); uiFreeControl(uiControl(c)); }
static void uiColorButtonDestroy(uiControl *c) { uiColorButton *b = uiColorButton(c); uiWindowsUnregisterWM_COMMANDHandler(b->hwnd); uiWindowsUnregisterWM_NOTIFYHandler(b->hwnd); uiWindowsEnsureDestroyWindow(b->hwnd); uiFreeControl(uiControl(b)); }
static void uiSpinboxDestroy(uiControl *c) { uiSpinbox *s = uiSpinbox(c); uiWindowsUnregisterWM_COMMANDHandler(s->edit); uiWindowsEnsureDestroyWindow(s->updown); uiWindowsEnsureDestroyWindow(s->edit); uiWindowsEnsureDestroyWindow(s->hwnd); uiFreeControl(uiControl(s)); }
static void uiGroupDestroy(uiControl *c) { uiGroup *g = uiGroup(c); if (g->child != NULL) { uiControlSetParent(g->child, NULL); uiControlDestroy(g->child); } uiWindowsEnsureDestroyWindow(g->hwnd); uiFreeControl(uiControl(g)); }
static void uiRadioButtonsDestroy(uiControl *c) { uiRadioButtons *r = uiRadioButtons(c); for (const HWND &hwnd : *(r->hwnds)) { uiWindowsUnregisterWM_COMMANDHandler(hwnd); uiWindowsEnsureDestroyWindow(hwnd); } delete r->hwnds; uiWindowsEnsureDestroyWindow(r->hwnd); uiFreeControl(uiControl(r)); }
static void uiFormDestroy(uiControl *c) { uiForm *f = uiForm(c); for (const struct formChild &fc : *(f->controls)) { uiControlSetParent(fc.c, NULL); uiControlDestroy(fc.c); uiWindowsEnsureDestroyWindow(fc.label); } delete f->controls; uiWindowsEnsureDestroyWindow(f->hwnd); uiFreeControl(uiControl(f)); }
static void uiWindowDestroy(uiControl *c) { uiWindow *w = uiWindow(c); // first hide ourselves ShowWindow(w->hwnd, SW_HIDE); // now destroy the child if (w->child != NULL) { uiControlSetParent(w->child, NULL); uiControlDestroy(w->child); } // now free the menubar, if any if (w->menubar != NULL) freeMenubar(w->menubar); // and finally free ourselves windows.erase(w); uiWindowsEnsureDestroyWindow(w->hwnd); uiFreeControl(uiControl(w)); }
static void uiWindowDestroy(uiControl *c) { uiWindow *w = uiWindow(c); // first hide ourselves gtk_widget_hide(w->widget); // now destroy the child if (w->child != NULL) { uiControlSetParent(w->child, NULL); uiUnixControlSetContainer(uiUnixControl(w->child), w->childHolderContainer, TRUE); uiControlDestroy(w->child); } // now destroy the menus, if any if (w->menubar != NULL) freeMenubar(w->menubar); gtk_widget_destroy(w->childHolderWidget); gtk_widget_destroy(w->vboxWidget); // and finally free ourselves // use gtk_widget_destroy() instead of g_object_unref() because GTK+ has internal references (see #165) gtk_widget_destroy(w->widget); uiFreeControl(uiControl(w)); }