mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[v2] docs(menu): add imports and complete the example (#4727)
* [v2] docs(menu): add imports and complete the example
- the example was missing imports, which [confused a user](https://stackoverflow.com/q/79827619/3431180), particularly due to the `rt` import alias
- plus there are a good number of imports too, which this makes explicit
- it also didn't mention that it built on top of the `NewApp` / `app.go` scaffold, so mention and link to that as well
- it wasn't clear where `NewApp` came from without that
- give this file the title `menu.go` for clarity / explicitness
- also handle the error at the end similar to [existing examples](4c464b3092/website/docs/guides/application-development.mdx (L54))
* add changelog entry per PR template
---------
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
parent
c73b2dd753
commit
cb3305a2fc
2 changed files with 2 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ It is possible to add an application menu to Wails projects. This is achieved by
|
|||
setting it in the [`Menu`](../reference/options.mdx#menu) application config, or by calling the runtime method
|
||||
[MenuSetApplicationMenu](../reference/runtime/menu.mdx#menusetapplicationmenu).
|
||||
|
||||
An example of how to create a menu:
|
||||
An example of how to create a menu, using [the `NewApp` scaffold](../guides/application-development.mdx):
|
||||
|
||||
```go
|
||||
app := NewApp()
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed
|
||||
|
||||
- Updated menu reference docs with complete imports by @agilgur5 in [#4727](https://github.com/wailsapp/wails/pull/4727)
|
||||
- Fixed menu reference syntax by @agilgur5 in [#4726](https://github.com/wailsapp/wails/pull/4726)
|
||||
- Fixed indentation in Application Development guide by @agilgur5 in [#4730](https://github.com/wailsapp/wails/pull/4730)
|
||||
- Updated Application Development guide to show imports in the `app.go` snippets by @agilgur5 in [#4731](https://github.com/wailsapp/wails/pull/4731)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue