bug-gnustep
[Top][All Lists]
Advanced

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

Re: Jumpy "Windows" menu


From: Richard Frith-Macdonald
Subject: Re: Jumpy "Windows" menu
Date: Sat, 15 Mar 2003 18:30:58 +0000


On Saturday, March 15, 2003, at 04:20  pm, Willem Rein Oudshoorn wrote:

Michael Hanni <mhanni@yahoo.com> writes:

In NSMenu.m, sizeToFit: make this modification (I'd send a patch, but the
blasted CVS server is not responding.)

  windowFrame = [_aWindow frame];
  [_aWindow setFrame: NSMakeRect(NSMinX(windowFrame),
                                 (NSMaxY(windowFrame) - size.height),
                                 size.width,
                                 size.height)
             display: NO];

Hm, this is almost OK, but there is a difference between setting the
frame.size of a window and setting the contentSize.
When setting the contentSize the window will account for the window
decoration, when setting the frame it does not.

Yep ... if you need to change the size of the contents of a window while
keeping the top left point the same, you need to use
+frameRectForContentRect:styleMask: to get the size of frame required,
then (if necessary) adjust the frame rect origin so that the top left corner
is the same as the current frame rect of the window, then call
-setFrame:display: to make the change.






reply via email to

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