i am using splash screen for my program but problem is that i want the canvas to be displayed in small size and in the centre of screen.if i adjust the size then it moves away from the centre of screen.Code is:
Code:
import Tkinter as tk
root = tk.Tk()
# show no frame
root.overrideredirect(True)
width = root.winfo_screenwidth()
height = root.winfo_screenheight()
root.geometry('%dx%d+%d+%d' % (width*0.8, height*0.8, width*0.1, height*0.1))
image_file = "10.gif"
# use Tkinter's PhotoImage for .gif files
image = tk.PhotoImage(file=image_file)
canvas = tk.Canvas(root, height=height*0.8, width=width*0.8, bg="brown")
canvas.create_image(width*0.8/2, height*0.8/2, image=image)
canvas.pack()
# show the splash screen for 1000 milliseconds then destroy
root.after(1000, root.destroy)
root.mainloop()
Comment