[Pas2js] is it possible to create GUi with no need to manually add the code to .html page

Mgr. Janusz Chmiel janusz.chmiel at volny.cz
Tue Aug 25 21:18:35 CEST 2020


Here is The code, but Browser still show empty page.

program project1;
{$mode objfpc}
uses
  browserapp, JS, Classes, SysUtils, Web, webwidget, htmlwidgets,
browserconsole;
type
  TMyApplication = class(TBrowserApplication)
    procedure doRun; override;
       public
     FMyPage: TWebPage;
     FMyButton: TButtonWidget;
   end;
procedure TMyApplication.doRun;
var
  datum: TDateTime;

begin

  FMyPage:=TWebPage.Create(Self);

FMyButton:=TButtonWidget.Create(Self);
FMyButton.Parent:=FMyPage;
FMyButton.Text:='Start The code';
  FMyPage.Refresh;

  Terminate;
end;
var
  Application : TMyApplication;
begin
  Application:=TMyApplication.Create(nil);
  Application.Initialize;
  Application.Run;
  Application.Free;
end.




More information about the Pas2js mailing list