diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-05 18:22:40 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-05 18:22:40 -0400 |
commit | 99bc76de54729df5494faa944d4da96a8885d51e (patch) | |
tree | a855999db11daed23007aaab866e273ffd275b86 /nexgb/examples/xinerama.go | |
parent | 369ad0d33e51035a3e48436fc85f60130b201437 (diff) | |
download | haven-99bc76de54729df5494faa944d4da96a8885d51e.tar.gz haven-99bc76de54729df5494faa944d4da96a8885d51e.tar.xz haven-99bc76de54729df5494faa944d4da96a8885d51e.zip |
examples. some should be tests
Diffstat (limited to 'nexgb/examples/xinerama.go')
-rw-r--r-- | nexgb/examples/xinerama.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/nexgb/examples/xinerama.go b/nexgb/examples/xinerama.go new file mode 100644 index 0000000..7fe9984 --- /dev/null +++ b/nexgb/examples/xinerama.go @@ -0,0 +1,29 @@ +package main + +import ( + "fmt" + "log" + + "github.com/BurntSushi/xgb" +) + +func main() { + X, _ := xgb.NewConn() + + err := X.RegisterExtension("xinerama") + if err != nil { + log.Fatal(err) + } + + reply, err := X.XineramaQueryScreens().Reply() + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Xinerama number: %d\n", reply.Number) + for i, screen := range reply.ScreenInfo { + fmt.Printf("%d :: X: %d, Y: %d, Width: %d, Height: %d\n", + i, screen.XOrg, screen.YOrg, screen.Width, screen.Height) + } +} + |