diff --git a/ui.h b/ui.h index b5fb9a27..b5330336 100644 --- a/ui.h +++ b/ui.h @@ -130,7 +130,7 @@ _UI_EXTERN void uiWindowSetBorderless(uiWindow *w, int borderless); _UI_EXTERN void uiWindowSetChild(uiWindow *w, uiControl *child); _UI_EXTERN int uiWindowMargined(uiWindow *w); _UI_EXTERN void uiWindowSetMargined(uiWindow *w, int margined); -_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar); +_UI_EXTERN uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar, int resizable); typedef struct uiButton uiButton; #define uiButton(this) ((uiButton *) (this)) diff --git a/unix/window.c b/unix/window.c index c5ba2038..83841e7b 100644 --- a/unix/window.c +++ b/unix/window.c @@ -229,7 +229,7 @@ void uiWindowSetMargined(uiWindow *w, int margined) uiprivSetMargined(w->childHolderContainer, w->margined); } -uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) +uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar, int resizable) { uiWindow *w; @@ -275,5 +275,7 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) // TODO we really need to clean this up, especially since see uiWindowDestroy() above g_object_ref(w->widget); + gtk_window_set_resizable(w->window, resizable?TRUE:FALSE); + return w; } diff --git a/windows/window.cpp b/windows/window.cpp index 2ea5b7ce..ef2933a2 100644 --- a/windows/window.cpp +++ b/windows/window.cpp @@ -452,7 +452,7 @@ static void setClientSize(uiWindow *w, int width, int height, BOOL hasMenubar, D logLastError(L"error resizing window"); } -uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) +uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar, int resizable) { uiWindow *w; WCHAR *wtitle; @@ -465,8 +465,11 @@ uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar) hasMenubarBOOL = TRUE; w->hasMenubar = hasMenubarBOOL; -#define style WS_OVERLAPPEDWINDOW -#define exstyle 0 + int style = WS_OVERLAPPEDWINDOW; + int exstyle = 0; + + if (!resizable) + style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX); wtitle = toUTF16(title); w->hwnd = CreateWindowExW(exstyle,