Ejemplo n.º 1
0
// Destroy is a simple alias to destroy a window. You should use this when
// you no longer intend to use this window. (It will free the X resource
// identifier for use in other places.)
func (w *Window) Destroy() {
	if !w.Destroyed {
		w.Detach()
		err := xproto.DestroyWindowChecked(w.X.Conn(), w.Id).Check()
		if err != nil {
			xgbutil.Logger.Println(err)
		}

		w.Destroyed = true
	}
}
Ejemplo n.º 2
0
// Destroy is a simple alias to destroy a window. You should use this when
// you no longer intend to use this window. (It will free the X resource
// identifier for use in other places.)
func (w *Window) Destroy() {
	if !w.Destroyed {
		w.Detach()
		err := xproto.DestroyWindowChecked(w.X.Conn(), w.Id).Check()
		if err != nil {
			panic(err)
		}

		w.Destroyed = true
	}
}