wails/v3/examples/window-menu
Lea Anthony fe717c42b5
Refactor to using Window interface (#4471)
Refactor window interface to eliminate type assertions and improve code maintainability
2025-08-09 15:28:08 +10:00
..
assets # Conflicts: 2025-01-17 21:19:23 +11:00
main.go Refactor to using Window interface (#4471) 2025-08-09 15:28:08 +10:00
README.md New ContextMenu API + example (#4013) 2025-01-23 22:10:23 +11:00

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

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.