Hey so I've made this error handler, it'd be ran if 2 specific buttons were enabled. The code:
def thirderror():
error2 = Toplevel()
error2.geometry("250x200")
error2.configure(bg = "#ffffff")
canvas2 = Canvas(
error2,
bg = "#ffffff",
height = 200,
width = 250,
bd = 0,
highlightthickness = 0,
relief = "ridge")
canvas2.place(x = 0, y = 0)
errorimg1_resp = requests.get("https://i.postimg.cc/jS8zFCc6/error0.png")
errorimg1 = ImageTk.PhotoImage(Image.open(BytesIO(errorimg1_resp.content)))
errorb1 = Button(
error2,
image = errorimg1,
borderwidth = 0,
highlightthickness = 0,
command = error2.destroy,
relief = "flat")
errorb1.place(
x = 0, y = 155,
width = 250,
height = 45)
backgroundimg3_resp = requests.get("https://i.postimg.cc/VNVPyTW0/background.png")
background_img3 = ImageTk.PhotoImage(Image.open(BytesIO(backgroundimg3_resp.content)))
background3 = canvas2.create_image(
125.0, 63.0,
image=background_img3)
error2.resizable(False, False)
For some reason right after it shows, the images (Background and button) disappear. Also I'm using a link to show the images because I want to convert it to an exe later and not have to have the images in the same directory.
Anyways, how do I fix the images?