Implemented uiParentDestroy() on the Windows and Unix backends. These don't actually *use* it yet; that'll come later. (Ultimately, there should only be one path into window destruction, which leads to one path in uiParent destruction and one path in child destruction.) More TODOs.
This commit is contained in:
parent
87296762b0
commit
1a76abef21
2
TODO.md
2
TODO.md
|
@ -14,6 +14,8 @@
|
|||
- buttons not in tab get drawover issues
|
||||
- buttons in tab without transparent drawing code get copied into the label when stack shown and rehidden
|
||||
- see if we can clean up the Darwin backend
|
||||
- make the Unix and Windows backend use uiParentDestroy() instead of relying on the autodestroy behavior of the backends
|
||||
- this requires explicitly handling delete events
|
||||
|
||||
ultimately:
|
||||
- make everything vtable-based
|
||||
|
|
|
@ -131,6 +131,15 @@ static void uipParent_class_init(uipParentClass *class)
|
|||
GTK_CONTAINER_CLASS(class)->forall = uipParent_forall;
|
||||
}
|
||||
|
||||
// TODO convert other methods of this + other backends to pp arg p instance variable
|
||||
|
||||
static void parentDestroy(uiParent *pp)
|
||||
{
|
||||
uipParent *p = uipParent(pp->Internal);
|
||||
|
||||
gtk_widget_destroy(GTK_WIDGET(p));
|
||||
}
|
||||
|
||||
static uintptr_t parentHandle(uiParent *p)
|
||||
{
|
||||
uipParent *pp = uipParent(p->Internal);
|
||||
|
@ -172,6 +181,7 @@ uiParent *uiNewParent(uintptr_t osParent)
|
|||
|
||||
p = uiNew(uiParent);
|
||||
p->Internal = g_object_new(uipParentType, NULL);
|
||||
p->Destroy = parentDestroy;
|
||||
p->Handle = parentHandle;
|
||||
p->SetMainControl = parentSetMainControl;
|
||||
p->SetMargins = parentSetMargins;
|
||||
|
|
|
@ -211,6 +211,14 @@ const char *initParent(HICON hDefaultIcon, HCURSOR hDefaultCursor)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void parentDestroy(uiParent *pp)
|
||||
{
|
||||
struct parent *p = (struct parent *) (pp->Internal);
|
||||
|
||||
if (DestroyWindow(p->hwnd) == 0)
|
||||
logLastError("error destroying uiParent window in parentDestroy()");
|
||||
}
|
||||
|
||||
static uintptr_t parentHandle(uiParent *p)
|
||||
{
|
||||
struct parent *pp = (struct parent *) (p->Internal);
|
||||
|
@ -262,6 +270,8 @@ uiParent *uiNewParent(uintptr_t osParent)
|
|||
(HWND) osParent, NULL, hInstance, p);
|
||||
if (pp->hwnd == NULL)
|
||||
logLastError("error creating uiParent window in uiNewParent()");
|
||||
|
||||
p->Destroy = parentDestroy;
|
||||
p->Handle = parentHandle;
|
||||
p->SetMainControl = parentSetMainControl;
|
||||
p->SetMargins = parentSetMargins;
|
||||
|
|
Loading…
Reference in New Issue