5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 06:20:48 +08:00

UTF-8 test

This commit is contained in:
Lea Anthony 2020-11-27 22:22:30 +11:00
parent dbe6000632
commit a0fe2f1e13
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
3 changed files with 16 additions and 4 deletions

10
v2/pkg/menu/README.md Normal file
View File

@ -0,0 +1,10 @@
# Menus
Menu support is heavily inspired by Electron's approach.
## Features
* Supports Text, Checkbox, Radio, Submenu and Separator
* Radio groups are defined as any number of adjacent radio items
* UTF-8 menu labels
* UTF-8 menu IDs

View File

@ -28,7 +28,9 @@ func (l *Dialog) WailsInit(runtime *wails.Runtime) error {
// m.Checked = false
// runtime.Menu.Update()
})
l.runtime.Menu.On("😀option-1", func(m *menu.MenuItem) {
fmt.Printf("We can use UTF-8 IDs: %s\n", m.Label)
})
return nil
}

View File

@ -47,9 +47,9 @@ func main() {
Checked: true,
},
menu.Separator(),
menu.Radio("Option 1", "option-1", true),
menu.Radio("Option 2", "option-2", false),
menu.Radio("Option 3", "option-3", false),
menu.Radio("😀 Option 1", "😀option-1", true),
menu.Radio("😺 Option 2", "option-2", false),
menu.Radio("❤️ Option 3", "option-3", false),
}),
})