예제 #1
0
// XPaint will write the contents of the pixmap to a window.
// Note that painting will do nothing if XDraw hasn't been called.
// XPaint is what switches the buffer (drawn to using XDraw) into the window
// to be visible. That is, multiple calls to XDraw can be made, and the screen
// will only be updated once with a call to XPaint.
func (im *Image) XPaint(wid xproto.Window) {
	// We clear the whole window here because sometimes we rely on the tiling
	// of a background pixmap. If anyone knows if this is a significant
	// performance problem, please let me know. (It seems like the whole area
	// of the window is cleared when it is resized anyway.)
	xproto.ClearArea(im.X.Conn(), false, wid, 0, 0, 0, 0)
}
예제 #2
0
// ClearAll is the same as Clear, but does it for the entire background pixmap.
func (w *Window) ClearAll() {
	xproto.ClearArea(w.X.Conn(), false, w.Id, 0, 0, 0, 0)
}
예제 #3
0
// Clear paints the region of the window specified with the corresponding
// background pixmap. If the window doesn't have a background pixmap,
// this has no effect.
// If width/height is 0, then it is set to the width/height of the background
// pixmap minus x/y.
func (w *Window) Clear(x, y, width, height int) {
	xproto.ClearArea(w.X.Conn(), false, w.Id,
		int16(x), int16(y), uint16(width), uint16(height))
}