我有一个无边框且透明(alpha值为.5)的NSwindow,如下图所示。现在我必须从此窗口中单击doc和desktop项目 我研究谷歌,找不到相关的
任何人都可以告诉我如何实现这一目标。
下面的代码用于创建NSWindow 。
NSRect screenRect = [[NSScreen mainScreen]frame];
captureItFullWindow = [[CapTureFullWindow alloc] initWithContentRect:screenRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO ];
[captureItFullWindow setLevel:NSScreenSaverWindowLevel];
[captureItFullWindow makeKeyAndOrderFront:self];
[captureItFullWindow setOpaque:NO]; //Tells the window manager that the window might have transparent parts.
[captureItFullWindow setBackgroundColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.3]];
答案 0 :(得分:0)
只有我必须设置窗口鼠标忽略属性
[self setIgnoresMouseEvents:YES];