Yes, but I always get this -gl error. Actually, the error is raised when I try to compile Pas2js_Designer_Package. This happens even if I remove -gl option under options of the package and try to recompile.
You need to install that package, not compile it. If you compile it from within a project that uses pas2js the package will be compiled with that as well, but that package is supposed to be compiled with FPC for inclusion with Lazarus.
Hi PascalDragon, ok, I got it, now it compiles, however no form is shown in web browser, what am I missing?
In IDE options, path of pas2js.exe: C:\Users\HT-ICT\Downloads\fpcupdeluxe\fpc\bin\x86_64-win64\pas2js.exe
In IDE options, path of simpleserver: C:\Users\HT-ICT\Downloads\fpcupdeluxe\fpc\bin\x86_64-win64\compileserver.exe
In project options, I added other unit files: ..\..\Downloads\fpcupdeluxe\lazarus\components\Pas2JS_Widget-master\pas2js\compiler\utils\pas2js\dist (this is trunk pas2js)
Custom compiler options: -Jeutf-8 -Jirtl.js -Jc -Jminclude -JRjs
program project1;
{$mode objfpc}
uses
Forms, Interfaces,
browserconsole, JS, Classes, SysUtils, Web, Unit1, Unit2;
begin
Application.Initialize;
Application.CreateForm(TWForm, WForm1);
WForm1.Show;
Application.Run;
end.
unit Unit1;
{$mode objfpc}
interface
uses
Forms, Interfaces,
JS, Classes, SysUtils, Graphics, Controls, Dialogs, WebCtrls;
type
{ TWForm1 }
TWForm1 = class(TWForm)
procedure WButton1Click(Sender: TObject);
private
public
end;
var
WForm1: TWForm1;
implementation
{$R *.lfm}
{ TWForm1 }
procedure TWForm1.WButton1Click(Sender: TObject);
begin
showmessage('Blago meni ako ovo proradi!');
end;
end.
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project1</title>
<script src="project1.js"></script>
</head>
<body>
<script>
alert("Zdravo 1!");
rtl.run();
alert("Zdravo 2!");
</script>
<div id="pasjsconsole"></div>
</body>
</html>
I get these two alerts, before and after rtl.run(), but there is no web form. What is wrong?