<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=CS link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Dear elite Pas2js developers,</p><p class=MsoNormal>Please could someone repair this wrong source code so button will be really clickable? So it will execute The command inside The procedure?</p><p class=MsoNormal>Thank you very much for your help.</p><p class=MsoNormal>Because I do not see at all this technique is one of othere which allow me to create GUI of many GUI elements and it will be readable on many devices. Sure, it is not so nice like if I would use The Bootstrap modules, but also this older technique fortunately work.</p><p class=MsoNormal>Thank you very much for your repair.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>program project1;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>{$mode objfpc}</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>uses</p><p class=MsoNormal> BrowserApp, browserconsole, JS, Classes, SysUtils, Web , webwidget, htmlwidgets;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>type</p><p class=MsoNormal> TMyApplication = class(TBrowserApplication)</p><p class=MsoNormal> protected</p><p class=MsoNormal> procedure DoRun; override;</p><p class=MsoNormal> procedure butClick(Sender: TObject);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> public</p><p class=MsoNormal> end;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>procedure TMyApplication.DoRun;</p><p class=MsoNormal>var</p><p class=MsoNormal> wp: TWebPage;</p><p class=MsoNormal>but: TButtonWidget;</p><p class=MsoNormal>begin</p><p class=MsoNormal> wp:=TWebPage.Create(Self);</p><p class=MsoNormal>wp.Parent:=TViewPort.Create(Nil);</p><p class=MsoNormal>but:=TButtonWidget.Create(Self);</p><p class=MsoNormal>but.Parent:=wp;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>but.Text:='Click Me';</p><p class=MsoNormal>but.Refresh;</p><p class=MsoNormal>wp.Refresh;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>end;</p><p class=MsoNormal>procedure TMyApplication.butClick(Sender: TObject);</p><p class=MsoNormal>begin</p><p class=MsoNormal> MaxConsoleLines := 1;</p><p class=MsoNormal>writeln ('Hello!');</p><p class=MsoNormal>end;</p><p class=MsoNormal>var</p><p class=MsoNormal> Application : TMyApplication;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>begin</p><p class=MsoNormal> Application:=TMyApplication.Create(nil);</p><p class=MsoNormal> Application.Initialize;</p><p class=MsoNormal> Application.Run;</p><p class=MsoNormal>end.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>