So i'm trying to make a gui and make images appear on the gui, but when I place an image onto the gui it starts flashing depending on where I drag the gui on my computer...
Heres code that causes this effect:
from tkinter import *
from threading import *
root = Tk()
root.resizable(False, False)
image1 = PhotoImage(file="GUI.png")
w = image1.width()
h = image1.height()
root.geometry("%dx%d+0+0" % (w, h))
panel1 = Label(root, image=image1)
panel1.pack(side='top', fill='both', expand='yes')
def PlaceImage():
global panel1
test = PhotoImage(file="test.png")
label = Label(panel1, image=test)
label.image = test
label.place(x=0, y=0)
def thethread():
PlaceImage()
thread = Thread(target=thethread)
thread.start()
root.mainloop()
The gui comes out just fine, but the image I place is what is glitchy. If anyone knows why this is and how to fix it that would be very helpful!
Do this to see if this eliminates the problem or if it is somewhere else.i.e. we have to know where the problem is before we can solve it. If this does solve the problem then try PIL imstead of PhotoImage next. I have no problem when I run on Linux That may also be because you run a newer version of Tkinter than the OP is running and it incorporates PIL into Tktinter where as the OP's does not.