ボタンをクリックした後、特定のウィンドウに線を引くにはどうすればよいですか?
私はこれを使用しています:
NSBezierPath * path = [NSBezierPath bezierPath];
[path setLineWidth: 4];
NSPoint startPoint = { 21, 21 };
NSPoint endPoint = { 128,128 };
[path moveToPoint: startPoint];
[path lineToPoint:endPoint];
[[NSColor redColor] set];
[path stroke];
しかし、それは私がそれを入れた場合にのみ機能します:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
どうすればこれを解決できますか? 私の目標は、受け取った詳細(座標)に従って、線を描画できるアプリケーションを作成することです
ありがとうございました。