5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 19:52:41 +08:00
wails/v3/examples/window-menu/README.md
Lea Anthony 631c8a1cc8
New ContextMenu API + example (#4013)
* New ContextMenu API + example

* Remove redundant code

* ContextMenuData now returns a string.
New Menu guide.

* Update readme

* Update v3/pkg/application/context.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Add new menubar option

* Fix docs

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-01-23 22:10:23 +11:00

25 lines
714 B
Markdown

# Window Menu Example
*** Windows Only ***
This example demonstrates how to create a window with a menu bar that can be toggled using the window.ToggleMenuBar() method.
## Features
- Default menu bar with File, Edit, and Help menus
- F1 key to toggle menu bar visibility
- Simple HTML interface with instructions
## Running the Example
```bash
cd v3/examples/window-menu
go run .
```
## How it Works
The example creates a window with a default menu and binds the F1 key to toggle the menu bar's visibility. The menu bar will show when F2 is pressed and hide when F3 is released.
Note: The menu bar toggling functionality only works on Windows. On other platforms, the F1 key binding will have no effect.