discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contentRectForFrameRect bad behaviour ?


From: Stéphane Goujet
Subject: Re: contentRectForFrameRect bad behaviour ?
Date: Thu, 03 Mar 2005 12:15:31 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Alexander Malmberg a écrit :
Fred Kiefer wrote:

  Thanks both of you for your explanations.

There are extension methods to get the screen rect for
a frame rect, and vice versa.

  Yes, that's what I needed !

  So the code should be :

-----------------------------------------------------------------------------
NSWindow *mainwin;
NSRect frame;
unsigned int style_mask;
        
...
        
frame=[[NSScreen mainScreen] visibleFrame]; /*For example, in my case*/

style_mask=NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask|NSTitledWindowMask;

#ifdef GNUSTEP
frame=[NSWindow frameRectForScreenRect: frame styleMask:style_mask];
#endif

frame=[NSWindow contentRectForFrameRect:frame styleMask:style_mask];

mainwin=[[NSWindow alloc]
        initWithContentRect:frame
        styleMask:style_mask
        backing:NSBackingStoreBuffered
        defer:NO];
-----------------------------------------------------------------------------

  At least, this works for me.

Goodbye,
         Stéphane.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]