Cocoa learning path: Check the program development instance of the bad spot on the screen

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.