comparison 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
comparison
equal deleted inserted replaced
1497:99a53823079f 1498:f8b4d6075cac
8593 8593
8594 if([ object isMemberOfClass:[ DWWindow class ] ]) 8594 if([ object isMemberOfClass:[ DWWindow class ] ])
8595 { 8595 {
8596 DWWindow *window = handle; 8596 DWWindow *window = handle;
8597 NSPoint point; 8597 NSPoint point;
8598 NSSize size = [window frame].size; 8598 NSSize size = [[window contentView] frame].size;
8599 8599
8600 /* Can't position an unsized window, so attempt to auto-size */
8601 if(size.width <= 1 || size.height <= 1)
8602 {
8603 /* Determine the contents size */
8604 dw_window_set_size(handle, 0, 0);
8605 }
8606
8607 size = [window frame].size;
8600 _handle_gravity(handle, &x, &y, (unsigned long)size.width, (unsigned long)size.height); 8608 _handle_gravity(handle, &x, &y, (unsigned long)size.width, (unsigned long)size.height);
8601 8609
8602 point.x = x; 8610 point.x = x;
8603 point.y = y; 8611 point.y = y;
8604 8612