home *** CD-ROM | disk | FTP | other *** search
- // Copyright (c) 1993, University of Kansas, All Rights Reserved
- //
- // Class: TClockView
- // Include File: TClockVi.H
- // Purpose: provide a clock view to the desktop
- // Remarks/Portability/Dependencies/Restrictions:
- // Revision History:
- // 12-13-93 created
- // 02-10-94 Split all members into seperate files.
- #include"tclockvi.h"
- #include<time.h>
- #include<string.h>
-
- void TClockView::update() {
- // Purpose: update the view if need be
- // Arguments: void
- // Return Value: void
- // Remarks/Portability/Dependencies/Restrictions:
- // Revision History:
- // 12-13-93 created
-
- time_t t_t = time(0);
- char *cp_date = ctime(&t_t);
-
- // extract the time.
- cp_date[19] = '\0';
- strcpy(PresTime, &cp_date[11]);
-
- // only if the time has changed
- if(strcmp(PastTime, PresTime)) {
- drawView();
- strcpy(PastTime, PresTime);
- }
- }