Re: Cocoa UI Size
Re: Cocoa UI Size
- Subject: Re: Cocoa UI Size
- From: Urs Heckmann <email@hidden>
- Date: Tue, 8 Jun 2010 16:44:02 +0200
Okay,
So I went a bit further on this.
I implemented my own setFrame and viewDidMoveToSuperview.
- (void)setFrame:(NSRect)frameRect
{
[super setFrame:frameRect];
NSLog(@"setFrame to %f %f %f %f", frameRect.origin.x, frameRect.origin.y, frameRect.size.width, frameRect.size.height );
}
-(void)viewDidMoveToSuperview
{
NSRect frame = [self frame];
NSLog(@"moved to superview %f %f %f %f", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height );
}
Here's what I get in the Debugger Console:
2010-06-08 16:28:53.411 AU Lab[3411:a0f] setFrame to 0.000000 0.000000 1018.000000 659.000000
2010-06-08 16:28:53.412 AU Lab[3411:a0f] all set up now!
2010-06-08 16:28:53.427 AU Lab[3411:a0f] moved to superview 0.000000 0.000000 1018.000000 659.000000
2010-06-08 16:28:53.435 AU Lab[3411:a0f] setFrame to 0.000000 0.000000 340.000000 121.000000
So. My code has correctly set teh view size to 1018 x 659 pixels. However, after AULab adds my view as a subview it resizes it to some odd 340 x 121 pixels.
So it'a clearly a bug in AULab then?
Cheers,
;) Urs
Am 06.06.2010 um 11:51 schrieb Urs Heckmann:
> Hi,
>
> What steps are necessary to do to tell the host of the initial size of a CocoaUI? - Using Nibs is not an option as the gui size may vary due to various circumstances that can't be predicted at shipping time.
>
> The following (simplified) code creates an NSView of 480 x 480 pixels, yet AULab opens a way too small window. When I close the window and reopen it, the window size is correct.
>
> - (NSView *)uiViewForAudioUnit:(AudioUnit)inAU withSize:(NSSize)inPreferredSize
> {
> // inPreferredSize is 0.0f/0.0f, that doesn't help at all
>
> NSView *returnView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 480, 480)];
>
> return [returnView autorelease];
> }
>
> Is there any further documentation on Cocoa UIs for AU that create views programatically? All I ever read is "This particular nib has a fixed size", and I've been wasting days already to figure it out. Or is it a bug in AULab even?
>
> Thanks,
>
> ;) Urs
>
>
> urs heckmann
> email@hidden
> www.u-he.com
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden