Commit 16b67790 authored by Serge A. Zaitsev's avatar Serge A. Zaitsev

changed menu declaration to c99 style

parent a1e7598f
...@@ -50,28 +50,35 @@ static struct tray tray = { ...@@ -50,28 +50,35 @@ static struct tray tray = {
.icon = TRAY_ICON1, .icon = TRAY_ICON1,
.menu = .menu =
(struct tray_menu[]){ (struct tray_menu[]){
{"Hello", 0, 0, hello_cb, NULL, NULL}, {.text = "Hello", .cb = hello_cb},
{"Checked", 0, 1, toggle_cb, NULL, NULL}, {.text = "Checked", .checked = 1, .cb = toggle_cb},
{"Disabled", 1, 0, NULL, NULL, NULL}, {.text = "Disabled", .disabled = 1},
{"-", 0, 0, NULL, NULL, NULL}, {.text = "-"},
{"Quit", 0, 0, quit_cb, NULL, NULL}, {.text = "SubMenu",
{"SubMenu", 0, 0, NULL, NULL, .submenu =
(struct tray_menu[]){ (struct tray_menu[]){
{"FIRST", 0, 1, submenu_cb, NULL, NULL}, {.text = "FIRST", .checked = 1, .cb = submenu_cb},
{"SECOND", 0, 0, NULL, NULL, {.text = "SECOND",
(struct tray_menu[]){ .submenu =
{"THIRD", 0, 0, NULL, NULL, (struct tray_menu[]){
(struct tray_menu[]){{"7", 0, 0, submenu_cb, NULL, NULL}, {.text = "THIRD",
{"-", 0, 0, NULL, NULL, NULL}, .submenu =
{"8", 0, 0, submenu_cb, NULL, NULL}, (struct tray_menu[]){
{NULL, 0, 0, NULL, NULL, NULL}}}, {.text = "7", .cb = submenu_cb},
{"FOUR", 0, 0, NULL, NULL, {.text = "-"},
(struct tray_menu[]){{"5", 0, 0, submenu_cb, NULL, NULL}, {.text = "8", .cb = submenu_cb},
{"6", 0, 0, submenu_cb, NULL, NULL}, {.text = NULL}}},
{NULL, 0, 0, NULL, NULL, NULL}}}, {.text = "FOUR",
{NULL, 0, 0, NULL, NULL, NULL}}}, .submenu =
{NULL, 0, 0, NULL, NULL, NULL}}}, (struct tray_menu[]){
{NULL, 0, 0, NULL, NULL, NULL}}, {.text = "5", .cb = submenu_cb},
{.text = "6", .cb = submenu_cb},
{.text = NULL}}},
{.text = NULL}}},
{.text = NULL}}},
{.text = "-"},
{.text = "Quit", .cb = quit_cb},
{.text = NULL}},
}; };
int main() { int main() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment