Add splash_screen_duration to GUIApplication class.#1144
Open
jonathanrocher wants to merge 1 commit intomainfrom
Open
Add splash_screen_duration to GUIApplication class.#1144jonathanrocher wants to merge 1 commit intomainfrom
jonathanrocher wants to merge 1 commit intomainfrom
Conversation
Contributor
corranwebster
left a comment
There was a problem hiding this comment.
If I'm guessing what you want, is for the splash screen to persist for at least a minimum amount of time so it is visible to the user.
Probably the right way of doing this is to instead modify start_event_loop to do something like
def start_event_loop(self):
if self._splash_screen is not None:
self.invoke_after(
self.splash_screen_duration * 1000, # milliseconds
self.self._splash_screen.close,
)
...
which avoids locking up the app, and also allows the user to dismiss by clicking on it.
| if self.gui is Undefined: | ||
| self.gui = GUI(splash_screen=self.splash_screen) | ||
| if self.splash_screen_duration > 0: | ||
| sleep(self.splash_screen_duration) |
Contributor
There was a problem hiding this comment.
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.
| splash_screen = Instance(ISplashScreen) | ||
|
|
||
| #: How long to display the splash screen, in seconds. Flashed by default. | ||
| splash_screen_duration = Int |
Contributor
There was a problem hiding this comment.
This should be a float.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding a new attribute
splash_screen_durationto control the duration for which the splash screen is shown upon application start.