UTF-8 test

This commit is contained in:
Lea Anthony
2020-11-27 22:22:30 +11:00
parent dbe6000632
commit a0fe2f1e13
3 changed files with 16 additions and 4 deletions
+10
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
+3 -1
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
}
+3 -3
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),
}),
})