Program Nag_me;

{$I "Include:Exec/Ports.i"}
{$I "Include:Exec/Libraries.i"}
{$I "Include:Graphics/Graphics.i"}
{$I "include:Graphics/Pens.i"}
{$I "Include:Intuition/Intuition.i"}


var
    W : WindowPtr;
    IM : IntuiMessagePtr;
    Quit : Boolean;
    t : Integer;

Const

    MyWindow : NewWindow = (0,0,100,30,-1,-1,
			CLOSEWINDOW_f,
			WINDOWDRAG + WINDOWDEPTH +
			WINDOWCLOSE,
			Nil, { Could add all gadgets automatically here }
			Nil,
			"",
			Nil,
			Nil,
			138,
			100,
			-1,-1,
			WBENCHSCREEN_f);

Function OpenNewWindow : Boolean;
begin
    W := OpenWindow(@MyWindow);
    OpenNewWindow := W <> Nil;
end;

begin
GfxBase := OpenLibrary("graphics.library",0);
    if OpenNewWindow then begin

    Move(W^.RPort,17,21);
    GText(W^.RPort,"Time up!",8);

	repeat
	    IM := IntuiMessagePtr(WaitPort(W^.UserPort));
	    IM := IntuiMessagePtr(GetMsg(W^.UserPort));
	    with IM^ do begin
		Quit := Class = CLOSEWINDOW_f;
	    end;
	    ReplyMsg(MessagePtr(IM));
	until Quit;
	CloseWindow(W);
    end else
	Writeln('Could not open the window');
CloseLibrary(GfxBase);
end.
