Hi can you please help me for this probleme (I'm sorry I'm not that good at english) I want the picture (photo 1) to be added after the tkinter has displayed from tkinter. I need the the photo 1 to appear after 5 seconds knowing that this is only one module of a "hole code" Here is my code:
from tkinter import *
import random
import time
import instructions_traits
x = float()
x = 0.0
aClique =0
Mafenetre = None
varcc = 0
def add():
global x
global Mafenetre
x+=0.001
Mafenetre.after(1,add)
def apparaitre(Canevas):
global photo1
photo1 = PhotoImage(file="homer simpson.gif")
item1 = Canevas.create_image(300,200,anchor=NW, image=photo1)
add()
def Clic(event):
global aClique
global x
global varcc
global Mafenetre
if aClique == 0:
aClique = 1
print (x)
if x <=0.350 and x >=0.2:
varb=0
if x >=0.351:
varb=5
Mafenetre.destroy()
instructions_traits.play(varcc, varb)
def play(varc):
# Creation de la fenetre principale (main window)
global Mafenetre
global varcc
varcc = varc
Mafenetre = Tk()
Mafenetre.title('jeu')
Mafenetre.configure(width=1550,height=700)
# Image de fond
photo = PhotoImage(file="fond homer.gif")
# Creation d'un widgetCanvas (zone graphique)
Largeur = 1550
Hauteur = 700
Canevas = Canvas(Mafenetre,width = Largeur, height =Hauteur)
Canevas.bind('<Button-1>', Clic)
item = Canevas.create_image(0,0,anchor=NW, image=photo)
Canevas.pack(side = LEFT, padx = 10, pady = 10)
"""Mafenetre.after(5000,apparaitre(Canevas))"""
time.sleep( 25 )
apparaitre(Canevas)
Mafenetre.mainloop()