lxn / walk

A Windows GUI toolkit for the Go Programming Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transparent background

D4v1dW3bb opened this issue · comments

How can I set the background to be `transparent?
The following is not working

func runApp() {
	mw := new(MyMainWindow)
	MainWindow{
		Title:    "Transparent Background",
		Visible:  false,
		MinSize:  Size{800, 600},
		Layout:   VBox{MarginsZero: true},
		AssignTo: &mw.MainWindow,
		Functions: map[string]func(args ...interface{}) (interface{}, error){
			"icon": func(args ...interface{}) (interface{}, error) {
				if strings.HasPrefix(args[0].(string), "https") {
					return "check", nil
				}

				return "stop", nil
			},
		},
	}.Create()

	win.SetBkMode(win.HDC(mw.Handle()), win.TRANSPARENT
	win.ShowWindow(mw.Handle(), win.SW_SHOW)
	mw.Run()
}