added separator items

This commit is contained in:
Serge A. Zaitsev
2017-01-09 14:21:44 +02:00
parent 14a8be3424
commit 1a4a1446f5
2 changed files with 50 additions and 31 deletions

View File

@@ -5,6 +5,12 @@
static struct tray tray;
static void toggle_cb(struct tray_menu *item) {
printf("toggle cb\n");
item->checked = !item->checked;
tray_update(&tray);
}
static void hello_cb(struct tray_menu *item) {
printf("hello cb\n");
if (strcmp(tray.icon, "indicator-messages") == 0) {
@@ -21,9 +27,12 @@ static void quit_cb(struct tray_menu *item) {
}
static struct tray tray = {
.menu = (struct tray_menu[]){{NULL, "Hello", 0, hello_cb, NULL},
{NULL, "Quit", 0, quit_cb, NULL},
{NULL, NULL, 0, NULL, NULL}},
.menu = (struct tray_menu[]){{"Hello", 0, 0, hello_cb, NULL},
{"Checked", 0, 1, toggle_cb, NULL},
{"Disabled", 1, 0, NULL, NULL},
{"-", 0, 0, NULL, NULL},
{"Quit", 0, 0, quit_cb, NULL},
{NULL, 0, 0, NULL, NULL}},
};
int main(int argc, char *argv[]) {