remove useless comanted function
This commit is contained in:
parent
a9e9dfc85b
commit
2a374dbf4b
@ -13,73 +13,6 @@
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include "memory.h"
|
||||
#include "strings.h"
|
||||
|
||||
/*
|
||||
size_t spawn_menu(uint16_t begin_y, uint16_t begin_x, const char** choices,
|
||||
size_t n_choices) {
|
||||
ITEM** sp_items;
|
||||
int c;
|
||||
MENU* sp_menu;
|
||||
WINDOW* sp_menu_win;
|
||||
int i;
|
||||
|
||||
sp_items = new ITEM*[n_choices];
|
||||
// Create items
|
||||
for (i = 0; i < n_choices; ++i) {
|
||||
sp_items[i] = new_item(choices[i], choices[i]);
|
||||
}
|
||||
|
||||
// Crate menu
|
||||
sp_menu = new_menu(sp_items);
|
||||
|
||||
// Create the window to be associated with the menu
|
||||
sp_menu_win = newwin(10, 40, begin_y, begin_x);
|
||||
keypad(sp_menu_win, TRUE);
|
||||
|
||||
// Set main window and sub window
|
||||
set_menu_win(sp_menu, sp_menu_win);
|
||||
set_menu_sub(sp_menu, derwin(sp_menu_win, 6, 38, begin_y - 1, begin_x - 3));
|
||||
|
||||
// Set menu mark to the string " * "
|
||||
set_menu_mark(sp_menu, " * ");
|
||||
|
||||
// Print a border around the main window and print a title
|
||||
box(sp_menu_win, 0, 0);
|
||||
print_in_middle(sp_menu_win, 1, 0, 40, "My Menu", COLOR_PAIR(1));
|
||||
mvwaddch(sp_menu_win, 2, 0, ACS_LTEE);
|
||||
mvwhline(sp_menu_win, 2, 1, ACS_HLINE, 38);
|
||||
mvwaddch(sp_menu_win, 2, 39, ACS_RTEE);
|
||||
mvprintw(LINES - 2, 0, "F1 to exit");
|
||||
refresh();
|
||||
|
||||
// Post the menu
|
||||
post_menu(sp_menu);
|
||||
wrefresh(sp_menu_win);
|
||||
|
||||
while ((c = wgetch(sp_menu_win)) != 10) {
|
||||
switch (c) {
|
||||
case KEY_DOWN:
|
||||
menu_driver(sp_menu, REQ_DOWN_ITEM);
|
||||
break;
|
||||
case KEY_UP:
|
||||
menu_driver(sp_menu, REQ_UP_ITEM);
|
||||
break;
|
||||
}
|
||||
wrefresh(sp_menu_win);
|
||||
}
|
||||
size_t selected = item_index(current_item(sp_menu));
|
||||
|
||||
// Unpost and free all the memory taken up
|
||||
unpost_menu(sp_menu);
|
||||
free_menu(sp_menu);
|
||||
for (i = 0; i < n_choices; ++i)
|
||||
free_item(sp_items[i]);
|
||||
delete[] sp_items;
|
||||
|
||||
return selected;
|
||||
}
|
||||
*/
|
||||
|
||||
void print_in_middle(WINDOW* win, int starty, int startx, int width,
|
||||
const char* string, chtype color) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user