/*
CLOCK.C
*/

#include <plib.h>
#include <wlib.h>

LOCAL_D WSERV_SPEC wSpec;
LOCAL_D UINT wMainWid;

LOCAL_C VOID MainEventLoop(VOID)
    {
    WS_EV event;

    for (;;)
        {
        wGetEventWait(&event);
        if (event.type==WM_REDRAW)
            {
            wBeginRedrawWinGC0(wMainWid);
            gBorder(W_BORD_SHADOW_D|W_BORD_SHADOW_ON);
            wEndRedraw();
            }
        }
    }

GLDEF_C VOID main(VOID)
    {
    wConnect(&wSpec,0,W_CONNECT_PRIORITY);
    wMainWid=wCreateWindow(0,0,0,1);
    wsCreateClock(wMainWid,WS_CLOCK_LARGE_ANALOG|WS_CLOCK_WITH_SECONDS,4,4,0);
    wsCreateClock(wMainWid,WS_CLOCK_MEDIUM|WS_CLOCK_FORCE_DIGITAL|
        WS_CLOCK_WITH_DATE,4+66+6,4,0);
    wsCreateClock(wMainWid,WS_CLOCK_MEDIUM|WS_CLOCK_FORCE_ANALOG|
        WS_CLOCK_WITH_DATE,4+66+6+36+6,4,0);
    wsCreateClock(wMainWid,WS_CLOCK_SMALL_DIGITAL|WS_CLOCK_WITH_DATE|
        WS_CLOCK_WITH_SECONDS,104,66,0);
    wInitialiseWindowTree(wMainWid);
    MainEventLoop();
    }
