Re: call "setContentBorderThickness:forEdge:" in Tiger
Re: call "setContentBorderThickness:forEdge:" in Tiger
- Subject: Re: call "setContentBorderThickness:forEdge:" in Tiger
- From: Georg Seifert <email@hidden>
- Date: Tue, 26 Aug 2008 07:17:21 +0200
Hi Matt,
Your code does the same than mine. The code in question is called only
on Leopard. But the problem occurs only there. Is seem that if you
have compiled against 10.4 you cannot call functions from the 10.5
SDK????
Is there some compatibility build setting or something else?
Georg
Hi Georg,
How about doing something like this? (typed in Mail, so check for
typos). Using the preprocessor macros should also be a *bit* more
efficient, since it won't be doing any checks at runtime.
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
windowStyle ^= NSTexturedBackgroundWindowMask;
#endif
self = [super initWithContentRect:contentRect styleMask:windowStyle
backing:bufferingType defer:deferCreation];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
[self setContentBorderThickness:27.0 forEdge: NSMinYEdge];
#endif
return self;
}
On Mon, Aug 25, 2008 at 12:22 PM, Georg Seifert
<email@hidden> wrote:
Hello,
I have a problem:
- (id)initWithContentRect:(NSRect)contentRect styleMask: (unsigned
int)windowStyle backing:(NSBackingStoreType)bufferingType defer:
(BOOL)deferCreation
{
BOOL useTextured = YES;
if([self
respondsToSelector:@selector(setContentBorderThickness:forEdge:)]) {
windowStyle ^= NSTexturedBackgroundWindowMask;
useTextured = NO;
}
self = [super initWithContentRect:contentRect
styleMask:windowStyle backing:bufferingType defer:deferCreation];
if(!useTextured)
{
[self setContentBorderThickness:27.0 forEdge:
NSMinYEdge];
}
return self;
}
if I compile against the 10.5 SDK everything work fine. But if I
use the 10.4 SDK it crashes:
*** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason:
'setContentBorderThickness:forEdge: may not be called with
NSMinXEdge'
(build and tested on Leopard, on Powerbook, latest OS and xCode)
Can someone help with this?
Thanks in advance.
Georg
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
@gmail.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden