Created
September 29, 2016 14:02
-
-
Save eyelash/ff0c88a187acb4cbd54f7af5323d52ff to your computer and use it in GitHub Desktop.
Cocoa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| project(test) | |
| find_library(COCOA Cocoa) | |
| add_executable(test MACOSX_BUNDLE main.m) | |
| target_link_libraries(test ${COCOA}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Cocoa/Cocoa.h> | |
| int main(int argc, char **argv) { | |
| @autoreleasepool { | |
| [NSApplication sharedApplication]; | |
| NSWindow *window = [[NSWindow alloc] | |
| initWithContentRect: CGRectMake(0, 0, 800, 600) | |
| styleMask: NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable | |
| backing: NSBackingStoreBuffered | |
| defer: false | |
| ]; | |
| [window setTitle: @"test"]; | |
| [window makeKeyAndOrderFront: nil]; | |
| [NSApp run]; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment