- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a Splash Screen using Tkinter?
Let us suppose that we want to create a splash screen using tkinter. To create a splash screen, we will follow the steps given below −
Create a splash screen with some labels in it.
Make the splash screen borderless using the overrideredirect method.
Create a function for the main window which will appear for a time just after the splash screen.
Now using the after method, we can define the time for which the main window will appear.
#Importing the tkinter library from tkinter import * #Create an instance of tkinter frame splash_win= Tk() #Set the title of the window splash_win.title("Splash Screen Example") #Define the size of the window or frame splash_win.geometry("700x200") #Remove border of the splash Window splash_win.overrideredirect(True) #Define the label of the window splash_label= Label(splash_win, text= "Hello World!", fg= "green", font= ('Times New Roman', 40)).pack(pady=20) def mainWin(): splash_win.destroy() win= Tk() win.title("Main Window") win.geometry("700x200") win_label= Label(win, text= "Main Window", font= ('Helvetica', 25), fg= "red").pack(pady=20) #Splash Window Timer splash_win.after(5000, mainWin) mainloop()
Running the above code will generate the output and will show the splash screen and after some time, the main window.
- How to create a simple screen using Tkinter?
- How do I create a splash screen on Android App?
- How can we implement a splash screen using JWindow in Java?
- How to create a timer using tkinter?
- Adding an animated loader and splash screen in a React Native app
- How to create a password entry field using Tkinter?
- How to create transparent widgets using Tkinter?
- How to center a window on the screen in Tkinter?
- How to get the screen size in Tkinter?
- How to display full-screen mode on Tkinter?
- Python to create a digital clock using Tkinter
- Creating Tkinter full-screen application
- How do I create a popup window using Tkinter?
- How to create a borderless fullscreen application using Python-3 Tkinter?
- How to create a Tkinter toggle button?