macOS/iOS API解説

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

目次

addCursorRect:cursor:

カーソル矩形をセットします
-(void)addCursorRect:(NSRect)aRect:
         cursor:(NSCursor *)aCursor:

解説

カーソル矩形をセットします。
resetCursorRectsメソッドから呼ばれるので通常呼び出しません。

返り値

( void )

なし

引数

( NSRect )aRect

範囲

( NSCursor * )aCursor

カーソル

フレームワーク

ApplicationKit

クラス

NSView

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
        //Imageを作る
        NSImage      *img;
        static NSCursor *cur = nil;
        //NSImageを作ってファイルから読み込む
        img = [NSImage imageNamed: @"cuimage" ];
        cur = [[NSCursor allocWithZone:[self zone]] initWithImage:img hotSpot:NSMakePoint(2.0,2.0)];
        [cur set];
    [sender addCursorRect : NSMakeRect(100,10,100,30) cursor:cur];
}

@end