summaryrefslogtreecommitdiff
path: root/examples/atom.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <[email protected]>2012-05-03 22:47:50 -0400
committerAndrew Gallant (Ocelot) <[email protected]>2012-05-03 22:47:50 -0400
commit9f44c6226003c93fd8a43bc0e35b433325c894eb (patch)
treef685f8c6fff1b3e6a4e115539c4788fee7988fb8 /examples/atom.go
parent9028aaf89872d8d90c65254c17658bfaf8a4918d (diff)
reworking xgb. cleaned up connection stuff a little. making new xid generation cleaner and use goroutines for it.
Diffstat (limited to 'examples/atom.go')
-rw-r--r--examples/atom.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/atom.go b/examples/atom.go
new file mode 100644
index 0000000..c64acee
--- /dev/null
+++ b/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)
+}
+