| 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 | 場所 |
| flags | YES/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
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSEvent | 修正日2006.12.26 |