# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1324397926 0 # Node ID 4468ac1db710bbcee609ebc3185b641877fceb26 # Parent 1794caee0758b312a493371b1fabfc2b88c80f66 Fixes building on OS/2 and reverted a change where I tried to not show the window while sizing on OS/2, but that seems to break the sizing code... will revisit this soon. diff -r 1794caee0758 -r 4468ac1db710 os2/dw.c --- a/os2/dw.c Tue Dec 20 16:10:13 2011 +0000 +++ b/os2/dw.c Tue Dec 20 16:18:46 2011 +0000 @@ -6907,7 +6907,7 @@ _get_window_for_size(handle, &width, &height); /* Finally set the size */ - WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SIZE); + WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE); } /* @@ -6949,6 +6949,20 @@ return colors; } +/* + * Sets the gravity of a given window (widget). + * Gravity controls which corner of the screen and window the position is relative to. + * Parameters: + * handle: Window (widget) handle. + * horz: DW_GRAV_LEFT (default), DW_GRAV_RIGHT or DW_GRAV_CENTER. + * vert: DW_GRAV_TOP (default), DW_GRAV_BOTTOM or DW_GRAV_CENTER. + */ +void API dw_window_set_gravity(HWND handle, int horz, int vert) +{ + dw_window_set_data(handle, "_dw_grav_horz", DW_INT_TO_POINTER(horz)); + dw_window_set_data(handle, "_dw_grav_vert", DW_INT_TO_POINTER(vert)); +} + /* Convert the coordinates based on gravity */ void _handle_gravity(HWND handle, long *x, long *y, unsigned long width, unsigned long height) { @@ -7011,7 +7025,7 @@ _handle_gravity(handle, &x, &y, width, height); /* Finally set the size */ - WinSetWindowPos(handle, NULLHANDLE, x, y, width, height, SWP_MOVE | SWP_SIZE); + WinSetWindowPos(handle, NULLHANDLE, x, y, width, height, SWP_SHOW | SWP_MOVE | SWP_SIZE); } /*