Beispiel #1
0
func (p *piece) Destroy() {
	if p.empty() {
		return
	}
	p.Window.Destroy() // detaches all event handlers
	xgraphics.FreePixmap(p.X, p.active)
	xgraphics.FreePixmap(p.X, p.inactive)
}
Beispiel #2
0
func (p *piece) Create(act, inact *xgraphics.Image) {
	if act != nil {
		if p.active > 0 {
			xgraphics.FreePixmap(p.X, p.active)
		}
		act.CreatePixmap()
		act.XDraw()

		p.active = act.Pixmap
	}
	if inact != nil {
		if p.inactive > 0 {
			xgraphics.FreePixmap(p.X, p.inactive)
		}
		inact.CreatePixmap()
		inact.XDraw()

		p.inactive = inact.Pixmap
	}
}