changed formatting

This commit is contained in:
Serge A. Zaitsev
2017-01-08 00:34:21 +02:00
parent fad5f0d87a
commit 12e79be088
2 changed files with 57 additions and 64 deletions

View File

@@ -5,33 +5,31 @@
static struct tray tray;
static void hello_cb(struct tray_menu *item) {
printf("hello cb\n");
if (strcmp(tray.icon, "indicator-messages") == 0) {
tray.icon = "indicator-messages-new";
} else {
tray.icon = "indicator-messages";
}
tray_update(&tray);
printf("hello cb\n");
if (strcmp(tray.icon, "indicator-messages") == 0) {
tray.icon = "indicator-messages-new";
} else {
tray.icon = "indicator-messages";
}
tray_update(&tray);
}
static void quit_cb(struct tray_menu *item) {
printf("quit cb\n");
tray_exit();
printf("quit cb\n");
tray_exit();
}
static struct tray tray = {
.icon = "indicator-messages-new",
.menu = (struct tray_menu[]){
{NULL, "Hello", 0, hello_cb, NULL},
{NULL, "Quit", 0, quit_cb, NULL},
{NULL, NULL, 0, NULL, NULL}
},
.icon = "indicator-messages-new",
.menu = (struct tray_menu[]){{NULL, "Hello", 0, hello_cb, NULL},
{NULL, "Quit", 0, quit_cb, NULL},
{NULL, NULL, 0, NULL, NULL}},
};
int main(int argc, char *argv[]) {
tray_init(&tray);
while (tray_loop(1) == 0) {
printf("iteration\n");
}
return 0;
tray_init(&tray);
while (tray_loop(1) == 0) {
printf("iteration\n");
}
return 0;
}