1
0
forked from Yadciel/c_tray

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 # Example
```c ```c
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 }
};
struct tray tray = { struct tray tray = {
.icon = "icon.png", .icon = "icon.png",
.menu = (struct tray_menu[]){{"Toggle me", 0, 0, toggle_cb, NULL}, .menu = menus,
{"-", 0, 0, NULL, NULL},
{"Quit", 0, 0, quit_cb, NULL},
{NULL, 0, 0, NULL, NULL}},
}; };
void toggle_cb(struct tray_menu *item) { void toggle_cb(struct tray_menu *item) {