mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-09 08:00:13 +08:00
[v3 windows] Dialogs to use invokeSync
This commit is contained in:
parent
c8dae94b5b
commit
a829b38a34
@ -100,7 +100,7 @@ func (d *MessageDialog) Show() {
|
||||
if d.impl == nil {
|
||||
d.impl = newDialogImpl(d)
|
||||
}
|
||||
d.impl.show()
|
||||
invokeSync(d.impl.show)
|
||||
}
|
||||
|
||||
func (d *MessageDialog) SetIcon(icon []byte) *MessageDialog {
|
||||
@ -248,7 +248,7 @@ func (d *OpenFileDialog) PromptForSingleSelection() (string, error) {
|
||||
if d.impl == nil {
|
||||
d.impl = newOpenFileDialogImpl(d)
|
||||
}
|
||||
selection, err := d.impl.show()
|
||||
selection, err := invokeSyncWithResultAndError(d.impl.show)
|
||||
var result string
|
||||
if len(selection) > 0 {
|
||||
result = selection[0]
|
||||
@ -272,7 +272,7 @@ func (d *OpenFileDialog) PromptForMultipleSelection() ([]string, error) {
|
||||
if d.impl == nil {
|
||||
d.impl = newOpenFileDialogImpl(d)
|
||||
}
|
||||
return d.impl.show()
|
||||
return invokeSyncWithResultAndError(d.impl.show)
|
||||
}
|
||||
|
||||
func (d *OpenFileDialog) SetMessage(message string) *OpenFileDialog {
|
||||
@ -412,7 +412,7 @@ func (d *SaveFileDialog) PromptForSingleSelection() (string, error) {
|
||||
if d.impl == nil {
|
||||
d.impl = newSaveFileDialogImpl(d)
|
||||
}
|
||||
return d.impl.show()
|
||||
return invokeSyncWithResultAndError(d.impl.show)
|
||||
}
|
||||
|
||||
func (d *SaveFileDialog) SetButtonText(text string) *SaveFileDialog {
|
||||
|
@ -13,7 +13,6 @@ type windowsDialog struct {
|
||||
}
|
||||
|
||||
func (m *windowsDialog) show() {
|
||||
globalApplication.dispatchOnMainThread(func() {
|
||||
//
|
||||
//// Mac can only have 4 Buttons on a dialog
|
||||
//if len(m.dialog.Buttons) > 4 {
|
||||
@ -69,7 +68,6 @@ func (m *windowsDialog) show() {
|
||||
// }
|
||||
//}
|
||||
panic("implement me")
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user