aboutsummaryrefslogtreecommitdiff
path: root/nexgb/examples/atom.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-03 22:47:50 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-03 22:47:50 -0400
commita5d4ad6c9d763b3d3f797075038023756c38bb28 (patch)
treeac8ef57ce2385ebe0ba2e112ad081a86241403d5 /nexgb/examples/atom.go
parent5cdae5950c357564300c0ee3fb4dc9e7bbf4946b (diff)
downloadhaven-a5d4ad6c9d763b3d3f797075038023756c38bb28.tar.gz
haven-a5d4ad6c9d763b3d3f797075038023756c38bb28.tar.xz
haven-a5d4ad6c9d763b3d3f797075038023756c38bb28.zip
reworking xgb. cleaned up connection stuff a little. making new xid generation cleaner and use goroutines for it.
Diffstat (limited to 'nexgb/examples/atom.go')
-rw-r--r--nexgb/examples/atom.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/nexgb/examples/atom.go b/nexgb/examples/atom.go
new file mode 100644
index 0000000..c64acee
--- /dev/null
+++ b/nexgb/examples/atom.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ // "fmt"
+ "log"
+
+ "github.com/BurntSushi/xgb"
+)
+
+func init() {
+ log.SetFlags(0)
+}
+
+func main() {
+ X, err := xgb.NewConn()
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ aname := "_NET_ACTIVE_WINDOW"
+ atom, err := X.InternAtom(true, uint16(len(aname)), aname)
+ if err != nil {
+ log.Fatal(err)
+ }
+ log.Printf("%d", atom.Atom)
+}
+