Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pyface/gui_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@


import logging
from time import sleep

from traits.api import (
Bool,
Callable,
Instance,
Int,
List,
ReadOnly,
Tuple,
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a float.


#: The about dialog for the application.
about_dialog = Instance(IDialog)

Expand Down Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This halts all processing for a number of seconds, and in particular the event loop will not be running so the app will be locked-up, which is generally not a good thing. At a minimum, this should occasionally be processing events.


# create the initial windows to show
self._create_windows()
Expand Down