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

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -