1

I was designing a GUI installer for my minecraft launcher. There are two frames of it,

Frame 1

here's the code of what happens when i click next....

def advance():

canvas.delete(id1)
canvas.delete(id2)

canvas.create_text(
760.0, 41.5,
text = "(1/2) Select installation directory",
fill = "#12e37f",
font = ("Sunshiney", int(16.0)))

b0.place_forget()

canvas.create_text(
    754.0, 127.5,
    text = "Choose an install location: ",
    fill = "#12e37f",
    font = ("Sunshiney", int(16.0)))

img1 = PhotoImage(file = f"data/img2.png")
b1 = Button(
    window,
    image = img1,
    borderwidth = 0,
    highlightthickness = 0,
    relief = "flat")

b1.place(
    x = 573, y = 550,
    width = 289,
    height = 98)

Here id1 and id2 are the text on the canvas. And the button too is said to get changed but when i click next, this happens in frame 2

Frame 2

the button gets removed but in it's place a blank space appears..... I don't know why is that happening.....

Any solutions?

  • Yes, it does. But only the cause is shown there. Any solutions as to the local variable of the image? I mean how can i put it globally? – bruce_wayne224 Oct 28 '21 at 15:13
  • @acw1668 Thanks for the indication towards the local variable, i worked out a solution and fixed my problem. Kudos to you! – bruce_wayne224 Oct 28 '21 at 15:18

0 Answers0