From 30dbde1b022c04642f9c84e94a8fdca6c6d5c323 Mon Sep 17 00:00:00 2001 From: Jonathan Rocher Date: Thu, 7 Jul 2022 11:21:19 +0200 Subject: [PATCH] Add splash_screen_duration to GUIApplication class. --- pyface/gui_application.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyface/gui_application.py b/pyface/gui_application.py index 8662555f8..721c24a67 100644 --- a/pyface/gui_application.py +++ b/pyface/gui_application.py @@ -21,11 +21,13 @@ import logging +from time import sleep from traits.api import ( Bool, Callable, Instance, + Int, List, ReadOnly, Tuple, @@ -64,6 +66,9 @@ class GUIApplication(Application): #: The splash screen for the application. No splash screen by default splash_screen = Instance(ISplashScreen) + #: How long to display the splash screen, in seconds. Flashed by default. + splash_screen_duration = Int + #: The about dialog for the application. about_dialog = Instance(IDialog) @@ -167,6 +172,8 @@ def start(self): # create the GUI so that the splash screen comes up first thing if self.gui is Undefined: self.gui = GUI(splash_screen=self.splash_screen) + if self.splash_screen_duration > 0: + sleep(self.splash_screen_duration) # create the initial windows to show self._create_windows()