[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Windows and content frame
From: |
Fred Kiefer |
Subject: |
Re: Windows and content frame |
Date: |
Mon, 18 Jul 2011 17:29:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11 |
On 18.07.2011 17:06, Riccardo Mottola wrote:
Hi,
I ported GMastermind to the Mac. It generates its windows and palettes
from code which is 100% shared between the gnustep and cocoa version.
Look:
http://3.bp.blogspot.com/-HQccn4C0TC8/TiNyME7hS2I/AAAAAAAAAOc/9LRGE_2tiLU/s1600/GMastermind_Panther.jpg
http://gap.nongnu.org/gmastermind/gmastermind_01_obsd.png
Do you see that on the mac there is a white space below the tile bar and
the window content? It is especially evident in the "Palette" window.
I fear we are doing "good" while we should not.
I tried enabling and disabling native window decorations (being
suspicious that the white space appears to be the window title bar
height) but no change.
Riccardo
I think the problem is in the way we create the window:
frame = [NSWindow frameRectForContentRect:[view frame]
styleMask:m];
window = [[NSWindow alloc] initWithContentRect:frame
styleMask:m
backing: NSBackingStoreBuffered
defer:NO];
This adds the window border twice! In the window creation we should use
[view frame] instead of frame. The frame is later used to set the min
and max size of the window. We could get that value from the window
itself there, which should be more accurate.
The interesting question is why GNUstep displays the window as expected.
Most likely the size restrictions are the reason for that.
Fred