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.


_______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to