[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 09:11:59 CEST 2020


Thank you for yours very kind access to my plea. Unfortunately, I Am still
getting error
Error: identifier not found "TWebPage
No matterwhen I add The line. If The line is located in The private session
or if I add The var declaration after 
procedure TMyApplication.doRun;
I only hope, that it is not necessary to manually register webwidget
package. Because visual designer for Lazarus is not usable for me with
screen reader. And if uses statement do not produce error, unit can be
found, it should not be The problem.
The next possibility is, if The problem is not being caused by The fact,
that TWebPage
data type is not declared in other unit than webwidgets.
or there is other hydden problem.
I Am running latest Lazarus trunk and latest Pas2js trunk together.
Sure, I have rebuilt Lazarus with special component .lpk package for Pas2js.
Here is my current code.
program Project1;

{$mode objfpc}

uses
  browserapp, JS, Classes, SysUtils, Web, webwidget;

type
  TMyApplication = class(TBrowserApplication)

    procedure doRun; override;
     end;


procedure TMyApplication.doRun;
         var
    FMyPage: TWebPage;
    FMyButton: TButtonWidget;

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


  Terminate;
end;

var
  Application : TMyApplication;

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



More information about the Pas2js mailing list