diff --git a/unix/menu.c b/unix/menu.c index f14dd488..a9eb2cd3 100644 --- a/unix/menu.c +++ b/unix/menu.c @@ -291,3 +291,8 @@ GtkWidget *makeMenubar(uiWindow *w) gtk_widget_set_halign(menubar, GTK_ALIGN_FILL); return menubar; } + +void freeMenubar(GtkWidget *mb) +{ + // TODO +} diff --git a/unix/uipriv_unix.h b/unix/uipriv_unix.h index 561ff8bc..fd75529b 100644 --- a/unix/uipriv_unix.h +++ b/unix/uipriv_unix.h @@ -18,3 +18,4 @@ extern char *strdupText(const char *); // menu.c extern GtkWidget *makeMenubar(uiWindow *); +extern void freeMenubar(GtkWidget *); diff --git a/unix/window.c b/unix/window.c index 90ee8349..f3d30b85 100644 --- a/unix/window.c +++ b/unix/window.c @@ -12,6 +12,8 @@ struct window { GtkContainer *vboxContainer; GtkBox *vbox; + GtkWidget *menubar; + uiContainer *bin; int hidden; @@ -46,7 +48,8 @@ static void windowDestroy(uiControl *c) // now destroy the bin // the bin has no parent, so we can just call uiControlDestroy() uiControlDestroy(uiControl(w->bin)); - // TODO menus + // now destroy the menus + freeMenubar(w->menubar); // now destroy ourselves // this will also free the vbox gtk_widget_destroy(w->widget); @@ -182,8 +185,10 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) // set the vbox as the GtkWindow child gtk_container_add(w->container, w->vboxWidget); - if (hasMenubar) - gtk_container_add(w->vboxContainer, makeMenubar(uiWindow(w))); + if (hasMenubar) { + w->menubar = makeMenubar(uiWindow(w)); + gtk_container_add(w->vboxContainer, w->menubar); + } w->bin = newBin(); binWidget = GTK_WIDGET(uiControlHandle(uiControl(w->bin)));