0
import Tkinter as tk
import Image, time, datetime


def splash_screen():

    root = tk.Tk()

    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 = "NHK.gif"
    image = tk.PhotoImage(file=image_file)
    canvas = tk.Canvas(root, height=height*0.8, width=width*0.8, bg="black")
    canvas.create_image(width*0.8/2, height*0.8/2, image=image)
    canvas.pack()

    
    root.after(10000, root.destroy)
    root.mainloop()
    return

splash_screen()

my_menu()# is defined at beginning of program

When I call the definition the picture NHK.GIF shows on a black background then disappears after 10 seconds.

The problem starts here; the program just stalls and nothing happens. Control is not given back to the main program ie, my menu doesn't print. When I hit close I get the message " The program is still running kill it? "

Please help I am very frustrated. I know the only problem in my code is in the splash_screen() Definition. Everything else runs flawlessly. The main purpose of this program is to teach basic survival skills.

Edited by Python Joe: n/a

4
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by Python Joe
0

Worked for me I just changed the name of image to one of minds and defind my_menu as simple print message. The message was printed OK.

0

Try replacing root.destroy with root.quit. Possibly the root window is destroyed but Tkinter is still running.

0

Try replacing root.destroy with root.quit. Possibly the root window is destroyed but Tkinter is still running.

OK, I tried that and it did make the program close, but a the black background did not disappear.

0

Ok, I looked at the example posted. I copied and pasted that one into a window, I get the same error. The Print statement never executes..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.