[Pas2js] please try to repair this wrong source code
Michael Van Canneyt
michael at freepascal.org
Fri Aug 23 11:16:49 CEST 2024
On Wed, 21 Aug 2024, Mgr. Janusz Chmiel via Pas2js wrote:
>
> Dear elite Pas2js developers,
>
> Please could some one of you try to repair this wrong source code?
>
> It do not react on button click event.
>
> Please, it is not long source code.
>
> Who of us would have The goow wil so this source code could work?
>
> Please send The rrepaired source code.
>
> Thank you very very much for your time.
>
>
>
> program project1;
>
>
>
> {$mode objfpc}
>
>
>
> uses
>
> BrowserApp, browserconsole, JS, Classes, SysUtils, Web , webwidget, htmlwidgets;
>
>
>
> type
>
> TMyApplication = class(TBrowserApplication)
>
> protected
>
> procedure DoRun; override;
>
> procedure butInput( _Sender : TObject; _Event : TJSEvent);
>
> public
>
> end;
>
>
>
> procedure TMyApplication.DoRun;
>
> var
>
> wp: TWebPage;
>
> but: TButtonWidget;
>
> begin
>
> wp:=TWebPage.Create(Self);
>
> wp.Parent:=TViewPort.Create(Nil);
>
> but:=TButtonWidget.Create(Self);
>
> but.Parent:=wp;
>
> but.OnInput := @butInput;
This should be
But.OnClick:= @butInput;
Michael.
More information about the Pas2js
mailing list