From 99bc76de54729df5494faa944d4da96a8885d51e Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sat, 5 May 2012 18:22:40 -0400 Subject: examples. some should be tests --- nexgb/examples/seq-nowrap.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 nexgb/examples/seq-nowrap.go (limited to 'nexgb/examples/seq-nowrap.go') diff --git a/nexgb/examples/seq-nowrap.go b/nexgb/examples/seq-nowrap.go new file mode 100644 index 0000000..994a07b --- /dev/null +++ b/nexgb/examples/seq-nowrap.go @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + for i := 1; i <= 1<<16 + 10; i++ { + X.NoOperation() + // fmt.Printf("%d. No-Op\n", i) + } + + aname := "_NET_ACTIVE_WINDOW" + + for i := 1; i <= 10; i++ { + atom, err := X.InternAtom(true, uint16(len(aname)), aname).Reply() + if err != nil { + fmt.Println(err) + } else { + fmt.Printf("%d. Sequence: %d, Atom: %d\n", + i, atom.Sequence, atom.Atom) + } + } +} + -- cgit v1.2.3-70-g09d2