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
|
// now destroy the bin
|
||||||
// the bin has no parent, so we can just call uiControlDestroy()
|
// the bin has no parent, so we can just call uiControlDestroy()
|
||||||
uiControlDestroy(uiControl(w->bin));
|
uiControlDestroy(uiControl(w->bin));
|
||||||
// now destroy the menus
|
// now destroy the menus, if any
|
||||||
freeMenubar(w->menubar);
|
if (w->menubar != NULL)
|
||||||
|
freeMenubar(w->menubar);
|
||||||
// now destroy ourselves
|
// now destroy ourselves
|
||||||
// this will also free the vbox
|
// this will also free the vbox
|
||||||
gtk_widget_destroy(w->widget);
|
gtk_widget_destroy(w->widget);
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
struct window {
|
struct window {
|
||||||
uiWindow w;
|
uiWindow w;
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
|
HMENU menubar;
|
||||||
uiContainer *bin;
|
uiContainer *bin;
|
||||||
int hidden;
|
int hidden;
|
||||||
BOOL shownOnce;
|
BOOL shownOnce;
|
||||||
|
@ -226,7 +227,6 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)
|
||||||
RECT adjust;
|
RECT adjust;
|
||||||
WCHAR *wtitle;
|
WCHAR *wtitle;
|
||||||
BOOL hasMenubarBOOL;
|
BOOL hasMenubarBOOL;
|
||||||
HMENU hmenu;
|
|
||||||
|
|
||||||
w = uiNew(struct window);
|
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));
|
binSetParent(w->bin, (uintptr_t) (w->hwnd));
|
||||||
|
|
||||||
if (hasMenubar) {
|
if (hasMenubar) {
|
||||||
hmenu = makeMenubar();
|
w->menubar = makeMenubar();
|
||||||
if (SetMenu(w->hwnd, hmenu) == 0)
|
if (SetMenu(w->hwnd, w->menubar) == 0)
|
||||||
logLastError("error giving menu to window in uiNewWindow()");
|
logLastError("error giving menu to window in uiNewWindow()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue