Created
October 4, 2013 17:30
-
-
Save hajimehoshi/6829595 to your computer and use it in GitHub Desktop.
Show a Cocoa window by Go
This file contains 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
package main | |
// #cgo CFLAGS: -x objective-c | |
// #cgo LDFLAGS: -framework Cocoa | |
// #import <Cocoa/Cocoa.h> | |
// | |
// void run() { | |
// @autoreleasepool { | |
// NSApplication* app = [NSApplication sharedApplication]; | |
// NSWindow* window = [[NSWindow alloc] | |
// initWithContentRect:NSMakeRect(0,0,200,200) | |
// styleMask:NSTitledWindowMask | |
// backing:NSBackingStoreBuffered | |
// defer:NO]; | |
// [window orderFrontRegardless]; | |
// [app run]; | |
// } | |
// } | |
// | |
import "C" | |
func main() { | |
C.run() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment