summaryrefslogtreecommitdiff
path: root/examples/gui/splashscreen/test.lpr
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gui/splashscreen/test.lpr')
-rw-r--r--examples/gui/splashscreen/test.lpr41
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/gui/splashscreen/test.lpr b/examples/gui/splashscreen/test.lpr
new file mode 100644
index 00000000..008d602b
--- /dev/null
+++ b/examples/gui/splashscreen/test.lpr
@@ -0,0 +1,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.
+
+
+