discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird crash related to NSFont usage


From: Andreas Höschler
Subject: Weird crash related to NSFont usage
Date: Fri, 9 Dec 2005 17:26:40 +0100

Hello all,

I have isolated the cause of a crash to the following method in a NSSubView subclass.

- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];

...
[[NSColor redColor] set];
#ifdef __APPLE__
[mark drawAtPoint:NSMakePoint(point.x + 5, point.y + 4) withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont labelFontOfSize:10.0], NSFontAttributeName, [NSColor redColor], NSForegroundColorAttributeName, nil]]; // the font stuff crashes GNUstep
#else
[mark drawAtPoint:NSMakePoint(point.x + 5, point.y + 4) withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSColor redColor], NSForegroundColorAttributeName, nil]];
#endif
...
}

If I put the [NSFont labelFontOfSize:10.0], NSFontAttributeName in the dictionary the app crashes somewhere in the depth of gui on GNUstep while it works flawlessly on MacOSX. Any idea what might cause the problem? For now I have worked around the problem withthe above #ifdef statement but it would be good to understand what causes the trouble in GNUstep.

Thanks!

Regards,

Andreas

reply via email to

[Prev in Thread] Current Thread [Next in Thread]