Untitled
public c v1 · immutableint check_time(TWidget * wid){ TWidget * menubar = (TWidget *)wid->data2; ttk_clockdata * cd = (ttk_clockdata *)wid->data; struct tm * timeinfo = &cd->time; time_t rawtime = time((time_t *)NULL); struct tm * check = localtime(&rawtime); if((check->tm_hour != timeinfo->tm_hour) || (check->tm_min != timeinfo->tm_min)) { printf("the time has changed!\n"); cd->time = *check; wid->draw(wid, menubar->win->srf); } return 0;}