Quellcode
- NSImage* tempIcon = [[NSImage alloc] initWithSize:NSMakeSize(21, 21)];
- [tempIcon lockFocus];
- [[NSColor colorWithDeviceRed:1.0 green:0.0 blue:0.0 alpha:1.0] set];
- [[NSBezierPath bezierPathWithRect:NSMakeRect(0, 0, 21, 21)] fill];
- [tempIcon unlockFocus];
- NSButton* tempButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 21, 21)];
- [tempButton setFrameOrigin:NSMakePoint(193, 755 - 61 - 21)];
- [tempButton setButtonType:NSMomentaryPushInButton];
- [tempButton setBezelStyle:NSShadowlessSquareBezelStyle];
- [tempButton setBordered:NO];
- [tempButton setImagePosition:NSImageOnly];
- [tempButton setImage:tempIcon];
- [self addSubview:tempButton];
- [tempIcon release];
- [tempButton release];
