Created
March 19, 2012 18:20
-
-
Save Wollw/2122658 to your computer and use it in GitHub Desktop.
Simple X11 Window in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
import ( | |
"exp/gui" | |
"exp/gui/x11" | |
"image" | |
) | |
func main() { | |
w,_ := x11.NewWindow() | |
ec := w.EventChan() | |
i := w.Screen() | |
c := image.RGBAColor{255,255,255,255} | |
for true { | |
e := <- ec | |
switch v := e.(type) { | |
case gui.MouseEvent: | |
i.Set(e.(gui.MouseEvent).Loc.X, e.(gui.MouseEvent).Loc.Y, c) | |
} | |
w.FlushImage() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment