0.3.1 Started working on dialogs. /JL

This commit is contained in:
2022-12-20 07:42:40 +01:00
parent 757fa04105
commit f7e0c48bdb
3 changed files with 35 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
package main
import (
"log"
"github.com/lxn/walk"
)
func (mw *MyMainWindow) openImage() error {
dlg := new(walk.FileDialog)
dlg.FilePath = UserPath
dlg.Filter = "Image Files (*.emf;*.bmp;*.exif;*.gif;*.jpeg;*.jpg;*.png;*.tiff)|*.emf;*.bmp;*.exif;*.gif;*.jpeg;*.jpg;*.png;*.tiff"
dlg.Title = "选择图片"
if ok, err := dlg.ShowOpen(mw.MainWindow); err != nil {
return err
} else if !ok {
return nil
}
prevFilePath := dlg.FilePath
log.Println("prevFilePath:", prevFilePath)
return nil
}