4 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
48 n_choices
= ARRAY_SIZE(choices
);
49 my_items
= (ITEM
**)calloc(n_choices
+ 1, sizeof(ITEM
*));
51 for(i
= 0; i
< n_choices
; ++i
)
52 my_items
[i
] = new_item(choices
[i
], choices
[i
]);
53 my_items
[n_choices
] = (ITEM
*)NULL
;
55 my_menu
= new_menu((ITEM
**)my_items
);
56 mvprintw(LINES
- 1, 0, "F2 to Exit");
60 while((c
= getch()) != KEY_F(2))
63 menu_driver(my_menu
, REQ_DOWN_ITEM
);
66 menu_driver(my_menu
, REQ_UP_ITEM
);
71 free_item(my_items
[0]);
72 free_item(my_items
[1]);
This page took 0.913868 seconds and 4 git commands to generate.