CocoaLearning pathBad screen pointsCheck the program development instance is the content described in this article, not to mention, directly go to the topic. ThisBad screen pointsThe principle of the check program is: red, green, blue, black, and white colors are displayed in full screen mode to detectScreenExist?Bad point, Dark spots, highlights. In full screen mode, click to switch to the next color and double-click to exit. Main LearningCocoaCreate a full screen window and event processing. The main references include:
RoundTransparentWindow, NSWindow, and NSEvent.
InCocoaThe full-screen window in must inherit NSWindow rewriting-(id) initWithContentRect, and set windowStyle to NSBorderlessWindowMask's borderless window
To respond to mouse events in a full-screen window, you must rewrite-(BOOL) canBecomeKeyWindow so that it always returns YES:
In InterfaceBuilder, You can bind a full-screen window Class with a Class to be rewritten for the window. In this way, a full screen window is created. You also need to create two events to handle color switching or close the full screen window. You need to switch to the next color when you click in the full screen window. If you double-click it, the full screen window will exit. The color switch of the mouseUp event processing is enabled. When the mouseDown event is clicked twice, the full screen window is exited.
Related attachments:Source code download and program download
Summary:CocoaLearning pathBad screen pointsCheck the content of the program development instance. I hope this article will help you!