Ich bin total ratlos. Ich will ein String zeichnen, Farbig und in Gross. Der Schriftzug wird aber immer nur in Schwarz und ca. 10pt dargestellt, egal was ich anstelle. Woran kann das liegen? Hab schon alles mögliche auskommentiert, was Seiteneffekte haben könnte.
Code-Schnipsel:
Alles anzeigen
Das Dictionary scheint auch zu passen:
Ideen? Was mach ich bloss falsch?
PS: An Position (0,0) ist OK, ist nur für den Test. Dort erscheint er auch. Nur halt SCHWARZ und KLEIN
Code-Schnipsel:
Quellcode
- - (void)drawRect:(NSRect)dirtyRect {
- NSGraphicsContext* theContext = [NSGraphicsContext currentContext];
- [self lockFocus];
- NSFont *tickFont = [NSFont labelFontOfSize:36.];
- if(!tickFont) {
- NSLog(@"NO SUCH FONT");
- }
- NSDictionary *attrs = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:NSFontAttributeName,
- NSForegroundColorAttributeName,
- nil]
- forKeys:[NSArray arrayWithObjects:tickFont,
- [NSColor redColor],
- nil]];
- NSString *theMsg = @"xPlease wait...";
- NSPoint outPt = NSMakePoint(0,0);
- [[NSColor redColor] set];
- [theMsg drawAtPoint:outPt withAttributes:attrs];
- [self unlockFocus];
- }
Das Dictionary scheint auch zu passen:
Ideen? Was mach ich bloss falsch?
PS: An Position (0,0) ist OK, ist nur für den Test. Dort erscheint er auch. Nur halt SCHWARZ und KLEIN
♥C++
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von zerm ()