python - tkinter photoimage constructor -
python - tkinter photoimage constructor -
i forced utilize plain photoimage class, since had many troubles installing pil on osx machine utilize - can live it, resorting utilize gif files.
trouble is, there's place need create new image of given color, size: simple colored square. there way it, à la image.new('rgb', size, color)
?
from tkinter import * #from tkinter root = tk() = photoimage(width=100, height=100) l = label(root, image=i) l.pack() i.put("{red}", to=(4,6,80,80)) root.update() root.after(3000) i.put("{blue}", to=(4,6,80,80)) root.mainloop()
python tkinter
Comments
Post a Comment