jnjackins / graphics

Go packages for creating graphical programs
MIT License
5 stars 0 forks source link

shiny drivers are very old #3

Closed joeblew99 closed 7 years ago

joeblew99 commented 7 years ago

trying out your editor

i cant get a build because of the vendored shiny drivers being too old. https://github.com/golang/exp/blob/master/shiny/driver/gldriver/gldriver.go

go version
go version go1.7.4 darwin/amd64
x-MacBook-Pro:edit apple$ go env
GOARCH="amd64"
GOBIN="/Users/apple/workspace/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/apple/workspace/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wp/ff6sz9qs6g71jnm12nj2kbyw0000gp/T/go-build909137846=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
x-MacBook-Pro:edit apple$ go run main.go
# github.com/jnjackins/graphics/vendor/golang.org/x/exp/shiny/driver/gldriver
../../vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m:109:23: warning: 'NSScrollWheel' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:82:26: note: 'NSScrollWheel' has been explicitly marked deprecated here
../../vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m:165:30: warning: 'NSKeyDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:74:26: note: 'NSKeyDown' has been explicitly marked deprecated here
../../vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m:243:15: warning: 'NSTitledWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:953:32: note: 'NSTitledWindowMask' has been explicitly marked deprecated here
../../vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m:246:23: warning: 'NSResizableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:956:32: note: 'NSResizableWindowMask' has been explicitly marked deprecated here
../../vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m:247:23: warning: 'NSMiniaturizableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:955:32: note: 'NSMiniaturizableWindowMask' has been explicitly marked deprecated here
../../vendor/golang.org/x/exp/shiny/driver/gldriver/cocoa.m:248:23: warning: 'NSClosableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:954:32: note: 'NSClosableWindowMask' has been explicitly marked deprecated here
# command-line-arguments
./main.go:27: undefined: widget
./main.go:29: undefined: widget
./main.go:63: undefined: loadFont
./main.go:75: undefined: updateFont
./main.go:76: undefined: fontFace in fontFace.Metrics
./main.go:81: undefined: newWidget
./main.go:81: undefined: fontFace
./main.go:85: undefined: loadMain
./main.go:89: undefined: newWidget
./main.go:89: undefined: fontFace
./main.go:89: too many errors
jnjackins commented 7 years ago

I believe those deprecated messages are just warnings. Please try using go build instead of go run main.go and it should build. I will look into updating the driver.

joeblew99 commented 7 years ago

thanks.

go build failed on src/github.com/jnjackins/graphics/cmd/edit with same error message and no binary output

So i figured that maybe its getting vendored and non vendored stuff mixed up, and so I deleted my src/golang.org/x/exp, to make sue it used your vendored ones and it still failed.

Hmmm stumped.... Might be best i try again when you have updated the dependencies. Really keen to try this out :)


About the cocoa errors. I fixed them and send them to Nigel about 6 months ago ( I did not want to use Gerrit, etc and so just pasted the fix into the issues list), and he put them into the tree so they should be fixed. SO you should get the fixes when you update your vendored files. https://github.com/golang/go/issues/17413

jnjackins commented 7 years ago

Unfortunately there are some changes in the vendored shiny packages here that I need to try to submit upstream to golang.org/x/exp/shiny. This was necessary to get smooth scrolling working properly on OS X. This also involved changing the mouse event API if I remember correctly, so the changes may not be accepted. For now I will patch in your changes, which will hopefully get your build working.

joeblew99 commented 7 years ago

ok then. I will give it another shot when your ready. I plan to do some MDL experimenting.

You should contact Nigel with the OSX scrolling changes. I reckon he will happily accept your changes.

jnjackins commented 7 years ago

@joeblew99 please try again now.

joeblew99 commented 7 years ago

ok, much better.

pwd
/Users/apple/workspace/go/src/github.com/jnjackins/graphics/cmd/edit
x-MacBook-Pro:edit apple$ go build main.go
# command-line-arguments
./main.go:27: undefined: widget
./main.go:29: undefined: widget
./main.go:63: undefined: loadFont
./main.go:78: undefined: updateFont
./main.go:79: undefined: fontFace in fontFace.Metrics
./main.go:84: undefined: newWidget
./main.go:84: undefined: fontFace
./main.go:88: undefined: loadMain
./main.go:92: undefined: newWidget
./main.go:92: undefined: fontFace
./main.go:92: too many errors

How to run it so its does not complain ? Need some ENV variables ??

jnjackins commented 7 years ago

You need to run go build with no arguments, or go run *.go. This is true in general for Go programs: go build/run main.go will only work if main.go is self-contained.

joeblew99 commented 7 years ago

thanks.

got one last bug..


go build
# github.com/jnjackins/graphics/cmd/edit
./main.go:148: cannot use e (type "github.com/jnjackins/graphics/vendor/golang.org/x/mobile/event/mouse".Event) as type "sigint.ca/graphics/vendor/golang.org/x/mobile/event/mouse".Event in argument to selected.ed.SendMouseEvent
jnjackins commented 7 years ago

Please try deleting everything under $GOPATH/src/github.com/jnjackins, and run go get -u -t sigint.ca/graphics/cmd/edit.

More info: https://golang.org/doc/go1.4#canonicalimports

joeblew99 commented 7 years ago

ok nuked and rerun from the canonical path

All works and runs now :) Fast too.