fix example

This commit is contained in:
vrd
2023-02-14 11:22:45 +02:00
parent e57affde26
commit f0290d21da
4 changed files with 26 additions and 8 deletions
+23
View File
@@ -375,6 +375,26 @@ void Tree::removeRelation(const unsigned first, const unsigned second)
}
}
static void displayHelp()
{
WINDOW* help_tab = newwin(LINES, COLS, 0, 0);
printw("%s\n", "Enter - focus the currently selected person",
"Arrow keys - move the camera",
"H, J, K, L - move the selection",
"I - display info about the selected person");
mvwaddstr(help_tab, LINES-1, 0, "Press any key to return.");
wrefresh(help_tab);
getch(); /* waint press */
werase(help_tab);
wrefresh(help_tab); /* todo: dont update */
delwin(help_tab);
}
void Tree::display()
{
draw();
@@ -386,6 +406,9 @@ void Tree::display()
switch(c)
{
case KEY_F(1):
displayHelp();
break;
case '\n':
focused_ = selected_;
draw();