From 679e4843d2af7bfab458dd4a1cde201d92300734 Mon Sep 17 00:00:00 2001 From: drc5521 <55195642+drc5521@users.noreply.github.com> Date: Thu, 29 Jan 2026 03:04:45 +0800 Subject: [PATCH] Update 03-notes-vanilla.mdx (#4917) * Update 03-notes-vanilla.mdx The API has been hanged. application.SaveFileDialog() -> application.Get().Dialog.SaveFile() application.OpenFileDialog() -> application.Get().Dialog.OpenFile() application.InfoDialog() -> application.Get().Dialog.Info() Please refer to the document. https://v3alpha.wails.io/reference/dialogs/ * Update docs/src/content/docs/tutorials/03-notes-vanilla.mdx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- docs/src/content/docs/tutorials/03-notes-vanilla.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/src/content/docs/tutorials/03-notes-vanilla.mdx b/docs/src/content/docs/tutorials/03-notes-vanilla.mdx index 329827c3a..bcdddf930 100644 --- a/docs/src/content/docs/tutorials/03-notes-vanilla.mdx +++ b/docs/src/content/docs/tutorials/03-notes-vanilla.mdx @@ -115,7 +115,7 @@ In this tutorial, you'll build a notes application that demonstrates file operat // SaveToFile saves notes to a file func (n *NotesService) SaveToFile() error { - path, err := application.SaveFileDialog(). + path, err := application.Get().Dialog.SaveFile(). SetFilename("notes.json"). AddFilter("JSON Files", "*.json"). PromptForSingleSelection() @@ -133,7 +133,7 @@ In this tutorial, you'll build a notes application that demonstrates file operat return err } - application.InfoDialog(). + application.Get().Dialog.Info(). SetTitle("Success"). SetMessage("Notes saved successfully!"). Show() @@ -143,7 +143,7 @@ In this tutorial, you'll build a notes application that demonstrates file operat // LoadFromFile loads notes from a file func (n *NotesService) LoadFromFile() error { - path, err := application.OpenFileDialog(). + path, err := application.Get().Dialog.OpenFile(). AddFilter("JSON Files", "*.json"). PromptForSingleSelection() @@ -163,7 +163,7 @@ In this tutorial, you'll build a notes application that demonstrates file operat n.notes = notes - application.InfoDialog(). + application.Get().Dialog.Info(). SetTitle("Success"). SetMessage("Notes loaded successfully!"). Show() @@ -180,8 +180,8 @@ In this tutorial, you'll build a notes application that demonstrates file operat - **Note struct**: Defines the data structure with JSON tags (lowercase) for proper serialization - **CRUD operations**: GetAll, Create, Update, and Delete for managing notes in memory - - **File dialogs**: Uses package-level functions `application.SaveFileDialog()` and `application.OpenFileDialog()` - - **Info dialogs**: Shows success messages using `application.InfoDialog()` + - **File dialogs**: Uses `application.Get().Dialog.SaveFile()` and `application.Get().Dialog.OpenFile()` to access native dialogs + - **Info dialogs**: Shows success messages using `application.Get().Dialog.Info()` - **ID generation**: Simple timestamp-based ID generator 3. **Update main.go**