Mercurial > dwindows
diff mac/dw.m @ 1498:f8b4d6075cac
Added auto-size support during dw_window_set_pos() on OS/2, Mac and Windows.
Since dw_window_set_pos() can have unexpected results on unsized windows... if a window is unsized attempt to auto-size at that point. Auto-sizing during dw_window_set_pos() will cause auto-sizing not to happen during dw_window_show() so make sure it is completely packed before setting the position.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 25 Dec 2011 13:56:30 +0000 |
parents | 99a53823079f |
children | dc41efe8a53f |
line wrap: on
line diff
--- a/mac/dw.m Sun Dec 25 06:58:53 2011 +0000 +++ b/mac/dw.m Sun Dec 25 13:56:30 2011 +0000 @@ -8595,8 +8595,16 @@ { DWWindow *window = handle; NSPoint point; - NSSize size = [window frame].size; - + NSSize size = [[window contentView] frame].size; + + /* Can't position an unsized window, so attempt to auto-size */ + if(size.width <= 1 || size.height <= 1) + { + /* Determine the contents size */ + dw_window_set_size(handle, 0, 0); + } + + size = [window frame].size; _handle_gravity(handle, &x, &y, (unsigned long)size.width, (unsigned long)size.height); point.x = x;