Hi , I am writing a program using Lazarus for my Raspberry Pi, but as using Lazarus on the Pi makes paint drying look fast, I am using Lazarus on my Windows machine and then transferring the code across. I am quite new to both pascal and linux, having used C/C++ under Windows for many years.
In this program, I have the main form and 2 other forms. I want each form to display for 5 seconds (fullscreen so only it shows) before moving on to the next. On each form, I have a button which when clicked halts sequencing and when clicked again restarts it. Under windows, all works well but on the Pi, it opens the second form and then stops unless I either close the form or click the hold button twice, when it moves on to the next and stops again.
On the main form, I have a timer set to 5000ms and its function contains:
procedure TMainForm.Timer1Timer(Sender: TObject);
begin
if pageCount = 2 then
pageCount := 0
else pageCount := pageCount + 1;
case pageCount of
0: WxForm.Close;
1: ElecForm.ShowModal;
2: begin
ElecForm.Close;
WxForm.ShowModal;
end;
end;
end;
The button function on each form is like this but obviously with differing form name:
procedure TMainForm.HoldBtnClick(Sender: TObject);
begin
if Timer1.Enabled = true then
begin
Timer1.Enabled := false;
HoldBtn.Caption := 'Continue';
end
else
begin
Timer1.Enabled := true;
HoldBtn.Caption := 'Hold';
end;
end;
Why the different behaviour between the two operating systems and how can I get it to work on the Pi as it does on the Windows machine?
Any help most appreciated.
Thanks