示例#1
0
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
	}
}
示例#2
0
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)
	}
}
示例#3
0
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)
}