func setImage(k wini.Key, place **xgraphics.Image) { if v, ok := getLastString(k); ok { img, err := xgraphics.NewFileName(X, v) if err != nil { logger.Warning.Printf( "Could not load '%s' as a png image because: %v", v, err) return } *place = img } }
func TestSetRoot(t *testing.T) { X := setup() bg, err := NewBackground(X) if err != nil { t.Errorf("%s\n", err) } // Errors in these functions are tested by TestSetImg, so we ignore them. img, _ := xgraphics.NewFileName(X, "kos-mos.png") SetImageToBg(X, bg, img, "LVDS1") if err = SetRoot(X, bg); err != nil { t.Errorf("%s\n", err) } }
func TestSetImg(t *testing.T) { X := setup() bg, err := NewBackground(X) img, err := xgraphics.NewFileName(X, "kos-mos.png") if err != nil { t.Errorf("%s\n", err) } if err = SetImageToBg(X, bg, img, "LVDS1"); err != nil { t.Errorf("%s\n", err) } //win := bg.XShowExtra("test", true) //bg.XPaint(win.Id) //xevent.Main(X) }