program Hello;

  uses Gem,GObjects;

  type TMyApplication = object(TApplication)
  												procedure InitMainWindow; virtual;
  											end;

  		 PMyWindow = ^TMyWindow;
  		 TMyWindow = object(TWindow)
  									 procedure Paint(var PaintInfo: TPaintStruct); virtual;
  								 end;

  var MyApplication: TMyApplication;


procedure TMyApplication.InitMainWindow;

	begin
		new(PMyWindow,Init(nil,''));
		if (MainWindow=nil) or (ChkError<em_OK) then Status:=em_InvalidMainWindow
	end;


procedure TMyWindow.Paint(var PaintInfo: TPaintStruct);

	begin
		v_gtext(vdiHandle,Work.X+GP.charWidth,Work.Y+GP.boxHeight,
		                               'Hello, ObjectGEM-world...')
	end;


begin
  MyApplication.Init('HWRL','Hello world');
  MyApplication.Run;
  MyApplication.Done
end.