summaryrefslogtreecommitdiff
path: root/examples/gui/splashscreen/test.lpr
blob: 008d602b931a617d32a4d3f828249e2e9be69fbf (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, fpgfx, gui_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.