NSEvent:otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:
Home 目次>ApplicationKit>NSEvent

otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:

カスタムイベントを作って返します


+(NSEvent *) otherEventWithType:(NSEventType)type
   location:(NSPoint)location
   modifierFlags:(unsigned int)flags
   timestamp:(NSTimeInterval)time
   windowNumber:(int)windowNum
   subtype:(NSGraphicsContext *)context
   subtype:(short)subtype
   data1:(int)data1
   data2:(int)data2


【返り値】
   NSEvent *イベント
【パラメータ】
   typeタイプ
   location場所
   flagsYES/NO
   time時間
   windowNumウインドウ番号
   contextコンテキスト
   subtypeサブタイプ
   data1データ1
   data2データ2


【解説】

カスタムイベントを作って返します。



【例文】


#import "MyScrollView.h"

@implementation MyScrollView
- (
void )mouseDown:(NSEvent *)event
{
NSEvent *ev = [NSEvent otherEventWithType:NSAppKitDefined
location:[event locationInWindow]
modifierFlags:
nil
timestamp:
nil
windowNumber:[event windowNumber]
context:[event context]
subtype:
nil
data1:
nil
data2:
nil
];

[NSApp sendEvent:ev];
NSLog([ev description]);
}

@end


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSEvent
修正日2006.12.26