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:
@ -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));
|
||||
}
|
Reference in New Issue
Block a user