wails/v3/examples
Lea Anthony fa06d48497
feat(v3): Add UseApplicationMenu option for cross-platform menu support (#4944)
* feat(v3): Add UseApplicationMenu option for cross-platform menu support

Add `UseApplicationMenu` option to `WebviewWindowOptions` that allows
windows on Windows and Linux to inherit the application menu set via
`app.Menu.Set()`.

This provides a simpler cross-platform approach:
- On macOS: No effect (app menu is always global)
- On Windows/Linux: Window displays the application menu

Benefits:
- Eliminates need for platform-specific menu code
- Per-window opt-in maintains backwards compatibility
- Explicit window menus still take priority

Updated:
- webview_window_options.go: Added UseApplicationMenu bool field
- webview_window_windows.go: Check UseApplicationMenu when no window menu set
- webview_window_linux.go: Check UseApplicationMenu when no window menu set
- examples/dialogs: Use UseApplicationMenu instead of conditional SetMenu
- examples/menu: Use UseApplicationMenu instead of explicit SetMenu
- docs: Updated menu and window options documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Remove incorrect 'Menu Options' section header

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:51:31 +11:00
..
android feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
badge [v3] Typed Events, revisited (#4633) 2025-11-11 20:25:57 +11:00
badge-custom [v3] Typed Events, revisited (#4633) 2025-11-11 20:25:57 +11:00
binding Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
build docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
cancel-async Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
cancel-chaining Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
clipboard docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
contextmenus Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
custom-protocol-example [v3] Typed Events, revisited (#4633) 2025-11-11 20:25:57 +11:00
dev feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
dialogs feat(v3): Add UseApplicationMenu option for cross-platform menu support (#4944) 2026-02-02 19:51:31 +11:00
dialogs-basic docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
dock [v3] macOS Dock Service (#4451) 2025-09-24 07:30:02 +00:00
drag-n-drop Enhance Drag-N-Drop README with Internal Drag and Drop Info (#4869) 2026-01-10 20:00:52 +11:00
environment Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
events-bug docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
file-association feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
frameless window.ToggleFrameless() api (#4317) 2025-07-15 22:53:21 +10:00
gin-example feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
gin-routing feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
gin-service feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
hide-window Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
ignore-mouse Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
ios feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
ios-poc Merge iOS support from v3-alpha-feature/ios-support 2025-12-10 18:34:21 +11:00
keybindings Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
liquid-glass fix(v3): overhaul drag-and-drop for Linux reliability and simplify Windows implementation (#4848) 2026-01-04 11:08:29 +11:00
menu feat(v3): Add UseApplicationMenu option for cross-platform menu support (#4944) 2026-02-02 19:51:31 +11:00
notifications feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
panic-handling docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
plain Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
print feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
raw-message [V3] Add origin to raw message handler (#4710) 2025-12-08 20:29:09 +11:00
screen Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
server feat(v3): add server mode for headless HTTP deployment (#4903) 2026-01-25 14:33:44 +11:00
services Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
show-macos-toolbar Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
single-instance Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
spotlight feat(macos): add CollectionBehavior option to MacWindow (#4799) 2025-12-29 11:07:37 +11:00
systray-basic Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
systray-clock [v3 alpha] windows tray minor refactor (#4653) 2025-11-04 07:44:58 +11:00
systray-custom Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
systray-menu docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
video Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
websocket-transport [V3] Refactor binding transport layer (#4702) 2025-12-07 22:19:12 +11:00
window docs: Update dialogs documentation to match actual v3 API (#4793) 2025-12-16 06:05:40 +11:00
window-api Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-call Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
window-menu Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
wml Refactor Manager API to use singular naming convention (#4367) 2025-06-22 12:19:14 +10:00
linux_status.org add linux status for examples 2023-11-06 10:49:14 -06:00
README.md Improve documentation 2023-12-13 22:40:35 +11:00

v3

NOTE: The examples in this directory may or may not compile / run at any given time during alpha development.

Running the examples

cd v3/examples/<example>
go mod tidy
go run .

Compiling the examples

cd v3/examples/<example>
go mod tidy
go build
./<example>