MCPcopy Create free account
hub / github.com/DISTRHO/DPF / puglSetResizable

Function puglSetResizable

dgl/src/pugl.cpp:344–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342// set view as resizable (or not) during runtime
343
344void puglSetResizable(PuglView* const view, const bool resizable)
345{
346 puglSetViewHint(view, PUGL_RESIZABLE, resizable ? PUGL_TRUE : PUGL_FALSE);
347
348 #if defined(DISTRHO_OS_HAIKU)
349 #elif defined(DISTRHO_OS_MAC)
350 if (PuglWindow* const window = view->impl->window)
351 {
352 const uint style = (NSClosableWindowMask | NSTitledWindowMask | NSMiniaturizableWindowMask)
353 | (resizable ? NSResizableWindowMask : 0);
354 [window setStyleMask:style];
355 }
356 // FIXME use [view setAutoresizingMask:NSViewNotSizable] ?
357 #elif defined(DISTRHO_OS_WASM)
358 puglUpdateSizeHints(view);
359 #elif defined(DISTRHO_OS_WINDOWS)
360 if (const HWND hwnd = view->impl->hwnd)
361 {
362 const uint winFlags = resizable ? GetWindowLong(hwnd, GWL_STYLE) | (WS_SIZEBOX | WS_MAXIMIZEBOX)
363 : GetWindowLong(hwnd, GWL_STYLE) & ~(WS_SIZEBOX | WS_MAXIMIZEBOX);
364 SetWindowLong(hwnd, GWL_STYLE, winFlags);
365 }
366 #elif defined(HAVE_X11)
367 puglUpdateSizeHints(view);
368 #endif
369}
370
371// --------------------------------------------------------------------------------------------------------------------
372// set window size while also changing default

Callers 1

setResizableMethod · 0.85

Calls 1

puglUpdateSizeHintsFunction · 0.85

Tested by

no test coverage detected