Split into category packages; module github.com/ZacharyZhang-NY/MujicaUI
This commit is contained in:
1822 files changed
+24568
-21314
No files matched your search
@@ -7,15 +7,15 @@
|
||||
## 最小示例
|
||||
|
||||
```go
|
||||
res := mujica.Menubar(c, []mujica.MenubarMenu{
|
||||
{Label: "File", Items: []mujica.MenubarItem{
|
||||
{ID: "new", Label: "New", Shortcut: mujica.MenubarShortcut{Mods: ui.Cmd, Key: ui.KeyN}},
|
||||
{Label: "Export", Items: []mujica.MenubarItem{{ID: "pdf", Label: "PDF"}}},
|
||||
res := navigation.Menubar(c, []navigation.MenubarMenu{
|
||||
{Label: "File", Items: []navigation.MenubarItem{
|
||||
{ID: "new", Label: "New", Shortcut: navigation.MenubarShortcut{Mods: ui.Cmd, Key: ui.KeyN}},
|
||||
{Label: "Export", Items: []navigation.MenubarItem{{ID: "pdf", Label: "PDF"}}},
|
||||
}},
|
||||
{Label: "View", Items: []mujica.MenubarItem{
|
||||
{ID: "wrap", Label: "Word wrap", Kind: mujica.MenubarCheck, Checked: wrap},
|
||||
{Label: "View", Items: []navigation.MenubarItem{
|
||||
{ID: "wrap", Label: "Word wrap", Kind: navigation.MenubarCheck, Checked: wrap},
|
||||
}},
|
||||
}, mujica.MenubarOptions{})
|
||||
}, navigation.MenubarOptions{})
|
||||
if id, ok := res.Chosen(); ok && id == "wrap" {
|
||||
wrap = !wrap
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user