1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 12:16:45 +02:00

put repeated code for printing time into a function

This commit is contained in:
Jfreegman
2013-10-11 01:11:43 -04:00
parent 42d4c92971
commit 17aead45ed
4 changed files with 19 additions and 28 deletions

View File

@ -95,3 +95,13 @@ char *wc_to_char(wchar_t ch)
return ret;
}
/* Prints the time to given window */
void print_time(WINDOW *window)
{
struct tm *timeinfo = get_time();
wattron(window, COLOR_PAIR(CYAN));
wprintw(window, "[%02d:%02d:%02d] ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
wattroff(window, COLOR_PAIR(CYAN));
}