I don't know if this is the βrightβ way to do it, but the first thing that comes to mind is to create a custom subclass of NSTextField that might look something like this:
- (void)awakeFromNib
{
[self setDrawsBackground:NO];
}
- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];
[self lockFocus];
[[NSImage imageNamed:@"<#image filename#>"] drawInRect:rect
fromRect:rect
operation:NSCompositeSourceOver
fraction:1.0];
[self unlockFocus];
}
Again, this is just a rough outline of the main parts.
, , , "" ( "" , ), NSTextField.
( ):
, ( , , Xcode , ).
NSTextField Objective-C (File β New File...), , NSTextField NSObject, , :
#import <Cocoa/Cocoa.h>
@interface BGImageTextField : NSTextField
{
}
@end
, (, BGImageTextField.m), @implementation @end.
. -, Cocoa Programming for Mac OS X Aaron Hillegass - Cocoa, , Cocoa . -, , , , , , , , , NSTextField.