The code below is simple i am just creating two frames and trying to display progressbar with image in first then after 6 seconds switching two frame 2 but the first frame is completely white for some reason. Hope someone can help :)
from PIL import ImageTk,Image
from tkinter import ttk
import time
frames=['frame1','frame2']
#canvas
root=Tk()
root.title('Anigame Tools V1.0')
root.iconbitmap('anigametoolsicon.ico')
#Frame Functions
frame1= Frame(root)
frame2= Frame(root)
frame1.pack()
frames=[frame1,frame2]
# progress bar
p = ttk.Progressbar(frame1, orient=HORIZONTAL, length=200, mode="determinate", takefocus=True, maximum=100)
p['value'] = 0
p.grid(row=1, column=0)
def start():
if p['value'] != 80:
p['value'] += 20
root.after(1000, start)
frame1.after(1000, start)
def show_frame(framename):
for i in frames:
i.pack_forget()
framename.pack()
# intro
intimg=Image.open("anigametoolsicon.png")
introimg = ImageTk.PhotoImage(intimg)
intro = Label(frame1,image=introimg)
intro.grid(row=0, column=0)
# frame2
anigametoolsad = Label(frame2, text='Anigame Tools Ver1.0')
anigametoolsad.grid(column=0, row=0, columnspan=3)
root.after(6000, show_frame(frame2))
root.mainloop()