0
사용자 정의 창을 작성했습니다. 이 창에서 nsbuttons를 보여줍니다. 버튼을 클릭하면 문맥 메뉴가 표시됩니다. 문제는 내가 창을 닫고 싶지 않지만 nsmenu에서 옵션을 선택하자마자 마우스가 종료 된 이벤트가 트리거되는 것입니다.사용자 정의 창 자동으로 문맥 메뉴 옵션을 선택하여 자동으로 닫기
이 효과를 방지하고 싶습니다. 알아낼 수 없습니다.
도움을 주시면 감사하겠습니다. 미리 덕분에
-(void)rightMouseDown:(NSEvent *)theEvent
{
NSMenu *theMenu = [[NSMenu alloc] initWithTitle:@"Contextual Menu"];
[[theMenu addItemWithTitle:@"Remove From List" action:@selector(removeWithIdentifier) keyEquivalent:@""] setTarget:self];
[[theMenu addItemWithTitle:@"Open" action:@selector(openAppWithIdentifier) keyEquivalent:@""] setTarget:self];
[theMenu popUpMenuPositioningItem:nil atLocation:NSMakePoint(self.bounds.size.width-20, self.bounds.size.height-10) inView:self];
}
-(void)removeWithIdentifier
{
//My custom view is getting mouse exited event from here
//I want prevent it.
}