I have been trying to work out how to use classes but everyone seems to use them so differently and it has left me confused and boggled.
I'm trying to insert the two images into a class but have no idea how to do so. Another thing I'm struggling with is how to put whatever I want destroying into a list to be sent to the function to remove the images instead of doing it individually?
If anyone can help explain to me how to do these things or show me how to do them (i learn best by example but got confused with examples not using my situation.)
import sys
from tkinter import *
from PIL import Image, ImageTk
SWH = Tk()
SWH.geometry("1024x950+130+0")
SWH.title("ServiceWhiz.")
#_#GlobalFunction#_
#ClearAllWidgets
def removewidgets(A, B):
A.destroy()
B.destroy()
return;
#_#LoadingPage#_
class SWLoad:
def __init__(self, master):
load = Image.open("Logo.png")
render = ImageTk.PhotoImage(load)
img = Label(SWH,image=render)
img.image = render
img.place(x=458,y=250)
load = Image.open("PoweredByServiceWhiz.png")
render = ImageTk.PhotoImage(load)
img1 = Label(SWH,image=render)
img1.image = render
img1.place(x=362,y=612.5)
img.after(3000, lambda: removewidgets(img, img1) )