From: David Elliott Date: Thu, 13 Nov 2003 14:33:30 +0000 (+0000) Subject: Very lame fix for windows with -1 for a component of position or size X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9f13cca8f677a12a0dd1ba5eca2ad33d84a62c95 Very lame fix for windows with -1 for a component of position or size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index ddb40bff3b..c1ef688bda 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -100,8 +100,19 @@ bool wxTopLevelWindowCocoa::Create(wxWindow *parent, if(style & wxFRAME_TOOL_WINDOW) cocoaStyle |= NSUtilityWindowMask; + wxPoint realpos = pos; + wxSize realsize = size; + // FIXME: this is lame + if(realpos.x==-1) + realpos.x=100; + if(realpos.y==-1) + realpos.y=100; + if(realsize.x==-1) + realsize.x=200; + if(realsize.y==-1) + realsize.y=200; // NOTE: y-origin needs to be flipped. - NSRect cocoaRect = [NSWindow contentRectForFrameRect:NSMakeRect(pos.x,pos.y,size.x,size.y) styleMask:cocoaStyle]; + NSRect cocoaRect = [NSWindow contentRectForFrameRect:NSMakeRect(realpos.x,realpos.y,realsize.x,realsize.y) styleMask:cocoaStyle]; m_cocoaNSWindow = NULL; m_cocoaNSView = NULL;