Separate tray_menu[] from tray in README.md example.
This commit is contained in:
committed by
Dmitry Mikushin
parent
185ec37d3e
commit
2bbb122d90
12
README.md
12
README.md
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user