conformal / gotk3

Go bindings for GTK3
ISC License
470 stars 81 forks source link

Add PixbufNewFromFile #70

Closed seppide closed 10 years ago

seppide commented 10 years ago

Sorry for the broken sub-commits. This is my first time working with git, so I haven't figured out how to use git rebase correctly yet.

weberc2 commented 10 years ago

This mostly looks good. I added a few comments above for things to look at. :)

jrick commented 10 years ago

You should use RefSink, not Ref, when incrementing the reference count on objects.

edit: oops, disregard. This is obviously the gdk package.

jrick commented 10 years ago

I'm unable to build this with the change to how the error string is accessed.

$ go get github.com/conformal/gotk3/gtk
# github.com/conformal/gotk3/gdk
../gdk/gdk.go:652: err._message undefined (type *C.struct__GError has no field or method _message)
jrick commented 10 years ago

Btw, I am able to access err.message directly (from Go) without needing the C wrapper. I assume there must be some differences in the headers on our systems (or even between different GTK versions -- I'm using 3.12.2). Can you check whether replacing err._message with just .message works (both here, and in the gtk package as well)?

seppide commented 10 years ago

I had basically misinterpreted http://golang.org/cmd/cgo/ which says:

"Within the Go file, C's struct field names that are keywords in Go can be accessed by prefixing them with an underscore".

I corrected that now...

jrick commented 10 years ago

Squashed and pushed with one extra godoc comment for PixbufRotation as 4217683e6b8f970b1af017d2096ff7f2443ecbc9.

seppide commented 10 years ago

Thanks.