Separate tray_menu[] from tray in README.md example.

This commit is contained in:
Rodrigo Madera
2021-03-27 14:55:32 -03:00
committed by Dmitry Mikushin
parent 185ec37d3e
commit 2bbb122d90

View File

@@ -67,12 +67,16 @@ $> a [Enter]
# Example
```c
struct tray tray = {
.icon = "icon.png",
.menu = (struct tray_menu[]){{"Toggle me", 0, 0, toggle_cb, NULL},
struct tray_menu menus[] = {
{ "Toggle me", 0, 0, toggle_cb, NULL },
{ "-" , 0, 0, NULL , NULL },
{ "Quit" , 0, 0, quit_cb , NULL },
{NULL, 0, 0, NULL, NULL}},
{ NULL , 0, 0, NULL , NULL }
};
struct tray tray = {
.icon = "icon.png",
.menu = menus,
};
void toggle_cb(struct tray_menu *item) {