添加弹窗支持

This commit is contained in:
Shikong 2023-07-23 01:27:42 +08:00
parent 536c12b280
commit 0c1e773247
4 changed files with 46 additions and 1 deletions

View File

@ -2,4 +2,12 @@
// This file is automatically generated. DO NOT EDIT
import {frontend} from '../models';
export function MessageDialog(arg1:frontend.MessageDialogOptions):Promise<string>;
export function OpenDirectoryDialog(arg1:frontend.OpenDialogOptions):Promise<string>;
export function OpenFileDialog(arg1:frontend.OpenDialogOptions):Promise<string>;
export function OpenMultipleFilesDialog(arg1:frontend.OpenDialogOptions):Promise<Array<string>>;
export function SaveFileDialog(arg1:frontend.SaveDialogOptions):Promise<string>;

View File

@ -2,6 +2,22 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function MessageDialog(arg1) {
return window['go']['dialog']['Support']['MessageDialog'](arg1);
}
export function OpenDirectoryDialog(arg1) {
return window['go']['dialog']['Support']['OpenDirectoryDialog'](arg1);
}
export function OpenFileDialog(arg1) {
return window['go']['dialog']['Support']['OpenFileDialog'](arg1);
}
export function OpenMultipleFilesDialog(arg1) {
return window['go']['dialog']['Support']['OpenMultipleFilesDialog'](arg1);
}
export function SaveFileDialog(arg1) {
return window['go']['dialog']['Support']['SaveFileDialog'](arg1);
}

View File

@ -30,7 +30,8 @@ func main() {
Width: 1024,
Height: 768,
AssetServer: &assetserver.Options{
Assets: assets,
Assets: assets,
Handler: app.Handler,
},
BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 1},
OnStartup: app.Startup,

View File

@ -17,3 +17,23 @@ func (s *Support) OpenFileDialog(dialogOptions runtime.OpenDialogOptions) string
path, _ := runtime.OpenFileDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) OpenMultipleFilesDialog(dialogOptions runtime.OpenDialogOptions) []string {
path, _ := runtime.OpenMultipleFilesDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) OpenDirectoryDialog(dialogOptions runtime.OpenDialogOptions) string {
path, _ := runtime.OpenDirectoryDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) SaveFileDialog(dialogOptions runtime.SaveDialogOptions) string {
path, _ := runtime.SaveFileDialog(s.app.Ctx(), dialogOptions)
return path
}
func (s *Support) MessageDialog(dialogOptions runtime.MessageDialogOptions) string {
path, _ := runtime.MessageDialog(s.app.Ctx(), dialogOptions)
return path
}