drawSwatchInRect:
現在のカラーでフォーカスしたビューに矩形を描きます
-(void)drawSwatchInRect:(NSRect)rect:
解説
現在のカラーでフォーカスしたビューに矩形(rect)を描きます。
カラーウエルなど色の見本を表示する他のオブジェクトから呼び出されます。通常使用しません。
返り値
( void )
なし
引数
( NSRect )rect
矩形
フレームワーク
ApplicationKit
クラス
NSColor
Instance Methods
使用可能
10.0
参照
例文
#import "Controller.h" @implementation Controller - (IBAction)myAction:(id)sender { NSColor *theColor = [NSColor redColor];//カラー作成 [theColor set]; [[[sender window] contentView] lockFocus]; [theColor drawSwatchInRect:NSMakeRect(0,0,100,100)]; [[[sender window] contentView] unlockFocus]; } @end