diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-10 17:01:42 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-10 17:01:42 -0400 |
commit | 0c50dc6241fa21712e041cfa2bfb9db4ccaef10a (patch) | |
tree | 90a3200414c8ad6df8e7983a8e73fedfbe2b324e /nexgb/doc.go | |
parent | e239bb3c68a4981a3916534203c2fbd6b96f593c (diff) | |
download | haven-0c50dc6241fa21712e041cfa2bfb9db4ccaef10a.tar.gz haven-0c50dc6241fa21712e041cfa2bfb9db4ccaef10a.tar.xz haven-0c50dc6241fa21712e041cfa2bfb9db4ccaef10a.zip |
a huge commit. splitting extensions into their own sub-packages.
Diffstat (limited to 'nexgb/doc.go')
-rw-r--r-- | nexgb/doc.go | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/nexgb/doc.go b/nexgb/doc.go index b6c956f..91c6406 100644 --- a/nexgb/doc.go +++ b/nexgb/doc.go @@ -24,6 +24,7 @@ accompanying documentation can be found in examples/create-window. import ( "fmt" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xproto" ) func main() { @@ -33,18 +34,19 @@ accompanying documentation can be found in examples/create-window. return } - wid, _ := X.NewId() - X.CreateWindow(X.DefaultScreen().RootDepth, wid, X.DefaultScreen().Root, + wid, _ := xproto.NewWindowId(X) + screen := xproto.Setup(X).DefaultScreen(X) + xproto.CreateWindow(X, screen.RootDepth, wid, screen.Root, 0, 0, 500, 500, 0, - xgb.WindowClassInputOutput, X.DefaultScreen().RootVisual, - xgb.CwBackPixel | xgb.CwEventMask, + xproto.WindowClassInputOutput, screen.RootVisual, + xproto.CwBackPixel | xproto.CwEventMask, []uint32{ // values must be in the order defined by the protocol 0xffffffff, - xgb.EventMaskStructureNotify | - xgb.EventMaskKeyPress | - xgb.EventMaskKeyRelease}) + xproto.EventMaskStructureNotify | + xproto.EventMaskKeyPress | + xproto.EventMaskKeyRelease}) - X.MapWindow(wid) + xproto.MapWindow(X, wid) for { ev, xerr := X.WaitForEvent() if ev == nil && xerr == nil { @@ -73,6 +75,7 @@ can be found in examples/xinerama. "fmt" "log" "github.com/BurntSushi/xgb" + "github.com/BurntSushi/xgb/xinerama" ) func main() { @@ -84,12 +87,12 @@ can be found in examples/xinerama. // Initialize the Xinerama extension. // The appropriate 'Init' function must be run for *every* // extension before any of its requests can be used. - err = X.XineramaInit() + err = xinerama.Init(X) if err != nil { log.Fatal(err) } - reply, err := X.XineramaQueryScreens().Reply() + reply, err := xinerama.QueryScreens(X).Reply() if err != nil { log.Fatal(err) } |