Thanks,
the sleep() was there because demo is simple and is executed too fast and I
needed to see whether splash is actually displayed.
In the real project I will not use sleep() in *.lpr nor elsewhere. I don't want
to waste user's time :)
______________________________________________________________
Od: Mattias Gaertner <[email protected]>
Komu: <[email protected]>
Datum: 08.05.2015 21:52
Předmět: Re: [Lazarus] What is main form? (Splash question)
On Fri, 08 May 2015 17:46:10 +0200
Vojtěch Čihák <[email protected]> wrote:
Hi,
what is main form from POV of Lazarus?
It is the first form created with Application.CreateForm, which
FormStyle is neither fsSplash nor fsMDIChild.
I made this demo:
program project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
sysutils,
Interfaces, // this includes the LCL widgetset
Forms, Unit1, Unit2, Unit3
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Initialize;
// Application.CreateForm(TFrmSplash, FrmSplash);
Don't forget to set FrmSplash.FormStyle to fsSplash.
// sleep(750);
On many platforms this won't work. Use
Application.ProcessMessages instead.
In general: don't use "sleep" in the main thread.
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TForm3, Form3);
// FrmSplash.Free;
Application.Run;
end.
Mattias
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus