summaryrefslogtreecommitdiff
path: root/examples/gui/splashscreen/test.lpr
blob: 296caa4f8cdb00281192a5cb664544180839753c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
program test;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes, fpg_main, fpg_form, frm_main, commands, frm_splashscreen;


procedure MainProc;
var
  frm: TMainForm;
begin
  fpgApplication.Initialize;
  Randomize;
  frm := TMainForm.Create(nil);

  // This is needed otherwise Splashscreen becomes main form. Rules are, the
  // first form displayed is the main form.
  fpgApplication.MainForm := frm;
  
  // Now create and show the splashscreen before the main form.
  frmSplash := TSplashForm.Create(nil);
  frmSplash.Show;

  try
    frm.Show;
    fpgApplication.Run;
  finally
    frm.Free;
  end;
end;

begin
  MainProc;
end.