diff options
| author | Andrew Gallant (Ocelot) <[email protected]> | 2012-05-10 17:01:42 -0400 |
|---|---|---|
| committer | Andrew Gallant (Ocelot) <[email protected]> | 2012-05-10 17:01:42 -0400 |
| commit | b618b2ea09167306cfe29b6966faf184bc893c2d (patch) | |
| tree | ebd8b505ebd83db1b891bc7a7f70d75f26e581e6 /doc.go | |
| parent | b10760ea62c5c071496a71d1d9ab6752989a309f (diff) | |
a huge commit. splitting extensions into their own sub-packages.
Diffstat (limited to 'doc.go')
| -rw-r--r-- | doc.go | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -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) } |
