added help info to card screen
This commit is contained in:
parent
a840cde3a4
commit
8ea5855715
1 changed files with 7 additions and 2 deletions
|
@ -39,7 +39,7 @@ int main(int argc, char **argv) {
|
|||
CARD *cards;
|
||||
WINDOW *main_card, *outer_text_card, *inner_text_container;
|
||||
int cards_ct, cc = 0, cf = 0, max_y, max_x;
|
||||
char k = '\0';
|
||||
char k = '\0', *help_message;
|
||||
|
||||
if (argc < 2)
|
||||
die("filename required");
|
||||
|
@ -117,7 +117,7 @@ int main(int argc, char **argv) {
|
|||
break;
|
||||
}
|
||||
|
||||
// print
|
||||
// print card # and text
|
||||
if (cf == 0) { // obverse
|
||||
mvwprintw(main_card, 0, 10, " Card #%d/%d [front] \r", cc + 1, cards_ct);
|
||||
wprintw(inner_text_container, "%s\r", cards[cc].obverse);
|
||||
|
@ -126,6 +126,11 @@ int main(int argc, char **argv) {
|
|||
wprintw(inner_text_container, "%s\r", cards[cc].reverse);
|
||||
}
|
||||
|
||||
// print help info
|
||||
help_message = "<j> next card <k> prev card <spc> flip card <q> quit";
|
||||
getmaxyx(main_card, max_y, max_x);
|
||||
mvwprintw(main_card, max_y - 2, max_x - 2 - strlen(help_message), "%s", help_message);
|
||||
|
||||
/// colors
|
||||
wbkgd(outer_text_card, COLOR_PAIR(2));
|
||||
wbkgd(main_card, COLOR_PAIR(1));
|
||||
|
|
Loading…
Reference in a new issue