mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 07:40:17 +08:00
29 lines
715 B
Go
29 lines
715 B
Go
package wails
|
|
|
|
// RuntimeDialog exposes an interface to native dialogs
|
|
type RuntimeDialog struct {
|
|
renderer Renderer
|
|
}
|
|
|
|
// newRuntimeDialog creates a new RuntimeDialog struct
|
|
func newRuntimeDialog(renderer Renderer) *RuntimeDialog {
|
|
return &RuntimeDialog{
|
|
renderer: renderer,
|
|
}
|
|
}
|
|
|
|
// SelectFile prompts the user to select a file
|
|
func (r *RuntimeDialog) SelectFile() string {
|
|
return r.renderer.SelectFile()
|
|
}
|
|
|
|
// SelectDirectory prompts the user to select a directory
|
|
func (r *RuntimeDialog) SelectDirectory() string {
|
|
return r.renderer.SelectDirectory()
|
|
}
|
|
|
|
// SelectSaveFile prompts the user to select a file for saving
|
|
func (r *RuntimeDialog) SelectSaveFile() string {
|
|
return r.renderer.SelectSaveFile()
|
|
}
|