From 34a8d6ecb9bf9b6f8512d34c9d3309459ce05520 Mon Sep 17 00:00:00 2001 From: Nominate Date: Mon, 5 Aug 2013 18:33:16 +0100 Subject: [PATCH] Added a 'clear' function to the prompt --- prompt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prompt.c b/prompt.c index 463b935..c28980c 100644 --- a/prompt.c +++ b/prompt.c @@ -158,7 +158,9 @@ static void execute(ToxWindow* self, char* cmd) { break; } } - + else if(!strcmp(cmd, "clear")) { + wclear(self->window); + } else if(!strcmp(cmd, "help")) { print_usage(self); } @@ -316,7 +318,7 @@ static void print_usage(ToxWindow* self) { wprintw(self->window, " myid : Print your ID\n"); wprintw(self->window, " quit/exit : Exit program\n"); wprintw(self->window, " help : Print this message again\n"); - + wprintw(self->window, " clear: : Clear this window\n"); wattron(self->window, A_BOLD); wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n");