Compare commits
1 Commits
c2113215e9
...
1576891247
Author | SHA1 | Date | |
---|---|---|---|
1576891247 |
21
README.md
21
README.md
|
@ -606,18 +606,21 @@ frameworks: [ Foundation, AppKit, CoreGraphics ]
|
|||
//go:generate nswrap
|
||||
package main
|
||||
|
||||
//go:generate nswrap
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"git.wow.st/gmp/nswrap/examples/app/ns" // point to your own NSWrap output directory
|
||||
"ns" // point to your own NSWrap output directory
|
||||
)
|
||||
|
||||
func didFinishLaunching(n *ns.NSNotification) {
|
||||
func didFinishLaunching(self ns.AppDelegate, n *ns.NSNotification) {
|
||||
fmt.Println("Go: did finish launching!")
|
||||
}
|
||||
|
||||
func shouldTerminate(s *ns.NSApplication) ns.BOOL {
|
||||
return 1
|
||||
func shouldTerminate(self ns.AppDelegate, s *ns.NSApplication) ns.BOOL {
|
||||
return true
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -629,7 +632,7 @@ var (
|
|||
func main() {
|
||||
runtime.LockOSThread()
|
||||
a = ns.NSApplicationSharedApplication()
|
||||
a.SetActivationPolicy(ns.NSApplicationActivationPolicyRegular)
|
||||
a.SetActivationPolicy(ns.NSApplicationActivationPolicy(ns.NSApplicationActivationPolicyRegular))
|
||||
del = ns.AppDelegateAlloc()
|
||||
del.ApplicationDidFinishLaunchingCallback(didFinishLaunching)
|
||||
del.ApplicationShouldTerminateAfterLastWindowClosedCallback(shouldTerminate)
|
||||
|
@ -637,9 +640,9 @@ func main() {
|
|||
|
||||
win = ns.NSWindowAlloc().InitWithContentRectStyleMask(
|
||||
ns.NSMakeRect(200,200,600,600),
|
||||
ns.NSWindowStyleMaskTitled | ns.NSWindowStyleMaskClosable,
|
||||
ns.NSBackingStoreBuffered,
|
||||
0,
|
||||
ns.NSWindowStyleMask(ns.NSWindowStyleMaskTitled | ns.NSWindowStyleMaskClosable),
|
||||
ns.NSBackingStoreType(ns.NSBackingStoreBuffered),
|
||||
false,
|
||||
)
|
||||
win.SetTitle(ns.NSStringWithGoString("Hi World"))
|
||||
win.MakeKeyAndOrderFront(win)
|
||||
|
@ -653,6 +656,8 @@ menus, visual format-based auto layout, and a custom button class.
|
|||
|
||||
## Subclasses
|
||||
|
||||
# NOTE: SUBCLASS FUNCTIONALITY IS CURRENTLY PARTIALLY BROKEN
|
||||
|
||||
NSWrap includes functionality to generate subclasses as specified in
|
||||
`nswrap.yaml`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user