macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setUpGState

GStateが作られる時に呼び出されます

解説

GStateが作られる時に呼び出されます。
サブクラスでオーバーライドします。
NSViewでは何もしません。

返り値

( void )

なし

引数

フレームワーク

ApplicationKit

クラス

NSView

Instance Methods

使用可能

10.0

参照

- allocateGState
- renewGState

例文

#import "MyImageView.h"

@implementation MyImageView
-(void)setUpGState
{

NSBezierPath *thePath = [NSBezierPath bezierPath];

[thePath moveToPoint:NSMakePoint(20,20)];
[thePath lineToPoint:NSMakePoint(120,120)];

[thePath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(50,50,150,100)]];
[[NSColor redColor] set];

[thePath stroke];
NSLog(@"!setUpGState!");
[super setUpGState];
}
@end