changed menu declaration to c99 style
This commit is contained in:
51
example.c
51
example.c
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user