Skip navigation.
 
mlRe: NSRect/NSButton bug?
FROM : j o a r
DATE : Sun Nov 24 22:27:01 2002

On Monday, Nov 25, 2002, at 00:18 Europe/Stockholm, Colin Cornaby wrote:

> The problem is if I set the y co-ord of the frame to itself the
> placement of the rect changes on screen. This just doesn't make sense.


True, that shouldn't happen. What about doing this:

[myButton setFrame: [myButton frame]];
[myButton setNeedsDisplay: YES];

(That was ObjC-code - but you can surely translate to the Java
equivalent)

Would the button size / placement still change? If that works, what
about doing this:

NSRect bFrame = [myButton frame];
[myButton: setFrame: NSMakeRect(bFrame.origin.x, bFrame.origin.y,
bFrame.size.width, bFrame.size.height)];
[myButton setNeedsDisplay: YES];

Note that I explicitly don't use anything but the values from the
struct derived from the button frame - to avoid mixing in any unknown
variables until we know that this works as it should. If it works,
start adding bits and pieces from your application source until you can
find the problem at hand.

> Maybe I should put together a demo project to show this.


Always a good idea!

j o a r



Related mailsAuthorDate
mlNSRect/NSButton bug? Colin Cornaby Nov 24, 12:23
mlRe: NSRect/NSButton bug? j o a r Nov 24, 14:56
mlRe: NSRect/NSButton bug? Colin Cornaby Nov 24, 15:20
mlRe: NSRect/NSButton bug? j o a r Nov 24, 22:27