Okay so I have a class and the main.py is calling the Background class which creates the permeate image. When created outside the class it creates the image when places inside it does not, I am dying please help.
main.py
from tkinter import *
from Classes import *
Master = Tk()
Master.geometry("1024x768")
Master.configure(background = "#000000")
Background(Master)
Master.resizable(False, False)
Master.mainloop()
Classes.py
from tkinter import *
class Background():
def __init__(self, Master):
self.Window = Frame(Master)
self.Window.configure(background = "#000000")
self.Window.place(x = 0, y = 0, width = 1024, height = 768)
self.Canvas = Canvas(master = self.Window, bg = "#000000", height = 768, width = 1024, bd = 0, highlightthickness = 0, relief = "ridge")
self.Canvas.place(x = 0, y = 0)
self.Backgroundimg = PhotoImage(file = f"Background/Background.png")
self.Background = self.Canvas.create_image(512.0, 384.0, image = self.Backgroundimg)
return
is a class
– xdeltaxen Nov 12 '22 at 02:43