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:
parent
dbe6000632
commit
a0fe2f1e13
10
v2/pkg/menu/README.md
Normal file
10
v2/pkg/menu/README.md
Normal 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
|
@ -28,7 +28,9 @@ func (l *Dialog) WailsInit(runtime *wails.Runtime) error {
|
|||||||
// m.Checked = false
|
// m.Checked = false
|
||||||
// runtime.Menu.Update()
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,9 +47,9 @@ func main() {
|
|||||||
Checked: true,
|
Checked: true,
|
||||||
},
|
},
|
||||||
menu.Separator(),
|
menu.Separator(),
|
||||||
menu.Radio("Option 1", "option-1", true),
|
menu.Radio("😀 Option 1", "😀option-1", true),
|
||||||
menu.Radio("Option 2", "option-2", false),
|
menu.Radio("😺 Option 2", "option-2", false),
|
||||||
menu.Radio("Option 3", "option-3", false),
|
menu.Radio("❤️ Option 3", "option-3", false),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user