passing NSRect struct as an arg
passing NSRect struct as an arg
- Subject: passing NSRect struct as an arg
- From: crucial felix <email@hidden>
- Date: Mon, 16 Dec 2002 20:36:57 -0500
first of all thanks for all the archives, i've been reading them a lot.
question:
in a view subclass i obtain my bounds:
NSRect bounds = [self bounds];
size is: 480 x 276
pass it to an object that draws:
[sfp drawWaveformFrom:0.0 to: [sfp duration] inRect: bounds];
SFP:
-(void)drawWaveformFrom: (float)start to:(float)end inRect:(NSRect)rect
{
NSLog(@"rect: %f %f",rect.size.width, rect.size.height);
..
}
and when it gets there its garbage
x: 3.5 y: -3.68934881e+19 size: 0 x 0
sorry if this is obvious, but web and archive searching hasn't solved
it for me.
should it be:
[sfp drawWaveformFrom:0.0 to: [sfp duration] inRect: &bounds];
-(void)drawWaveformFrom: (float)start to:(float)end inRect:(NSRect*)rect
?
-felix
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.