Started Windows menu destruction code and fixed a bug in GTK+ menu destruction.
This commit is contained in:
parent
14de9f3cad
commit
b52aa4cfcb
|
@ -48,8 +48,9 @@ static void windowDestroy(uiControl *c)
|
|||
// now destroy the bin
|
||||
// the bin has no parent, so we can just call uiControlDestroy()
|
||||
uiControlDestroy(uiControl(w->bin));
|
||||
// now destroy the menus
|
||||
freeMenubar(w->menubar);
|
||||
// now destroy the menus, if any
|
||||
if (w->menubar != NULL)
|
||||
freeMenubar(w->menubar);
|
||||
// now destroy ourselves
|
||||
// this will also free the vbox
|
||||
gtk_widget_destroy(w->widget);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
struct window {
|
||||
uiWindow w;
|
||||
HWND hwnd;
|
||||
HMENU menubar;
|
||||
uiContainer *bin;
|
||||
int hidden;
|
||||
BOOL shownOnce;
|
||||
|
@ -226,7 +227,6 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
|||
RECT adjust;
|
||||
WCHAR *wtitle;
|
||||
BOOL hasMenubarBOOL;
|
||||
HMENU hmenu;
|
||||
|
||||
w = uiNew(struct window);
|
||||
|
||||
|
@ -260,8 +260,8 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
|||
binSetParent(w->bin, (uintptr_t) (w->hwnd));
|
||||
|
||||
if (hasMenubar) {
|
||||
hmenu = makeMenubar();
|
||||
if (SetMenu(w->hwnd, hmenu) == 0)
|
||||
w->menubar = makeMenubar();
|
||||
if (SetMenu(w->hwnd, w->menubar) == 0)
|
||||
logLastError("error giving menu to window in uiNewWindow()");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue