Re: Getting an NSView's size
Re: Getting an NSView's size
- Subject: Re: Getting an NSView's size
- From: Candide Kemmler <email@hidden>
- Date: Tue, 10 Jul 2001 15:24:42 +0200
OK OK stupid me, I'd have to replace the %d's with %f's. Not really used
yet to this printf syntax :-(
Le mardi 10 juillet 2001, ` 02:21, Stiphane Sudre a icrit :
On mardi, juillet 10, 2001, at 01:50 PM, Candide Kemmler wrote:
Hi,
I'm trying to request an NSView's size like I would with
java.awt.Component.getSize () in java.
I tried (in drawRect:(NSRect)frame):
NSLog ( @"the frame is %d, %d, %d, %d", frame.origin.x,
frame.origin.y, frame.size.width, frame.size.height );
and
NSLog ( @"the bounds are %d, %d, %d, %d", [self bounds].origin.x,
[self bounds].origin.y, [self bounds].size.width, [self
bounds].size.height );
...but both yield 0,0,0,0
I thought the bounds would provide the information I want, but I
apparently don't get something here...
[self frame]