diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-07 04:09:19 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-07 04:09:19 -0400 |
commit | dc48249e1acea54b391f53b95f16e515dead7c97 (patch) | |
tree | 3467fee8294f8800977de0df3030d82e69bb7528 /nexgb/examples/property.go | |
parent | 3bf376bd6648e011de9131c1d90a39c6d3890d65 (diff) | |
download | haven-dc48249e1acea54b391f53b95f16e515dead7c97.tar.gz haven-dc48249e1acea54b391f53b95f16e515dead7c97.tar.xz haven-dc48249e1acea54b391f53b95f16e515dead7c97.zip |
lots of docs and examples
Diffstat (limited to 'nexgb/examples/property.go')
-rw-r--r-- | nexgb/examples/property.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/nexgb/examples/property.go b/nexgb/examples/property.go deleted file mode 100644 index 45144c7..0000000 --- a/nexgb/examples/property.go +++ /dev/null @@ -1,41 +0,0 @@ -package main - -import ( - "log" - - "github.com/BurntSushi/xgb" -) - -func init() { - log.SetFlags(0) -} - -func get32(buf []byte) uint32 { - v := uint32(buf[0]) - v |= uint32(buf[1]) << 8 - v |= uint32(buf[2]) << 16 - v |= uint32(buf[3]) << 24 - return v -} - -func main() { - X, err := xgb.NewConn() - if err != nil { - log.Fatal(err) - } - - root := X.DefaultScreen().Root - - aname := "_NET_ACTIVE_WINDOW" - atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() - if err != nil { - log.Fatal(err) - } - - reply, err := X.GetProperty(false, root, atom.Atom, - xgb.GetPropertyTypeAny, 0, (1<<32)-1).Reply() - if err != nil { - log.Fatal(err) - } - log.Printf("%X", get32(reply.Value)) -} |