Python Forum
[Tkinter] GUI Speed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] GUI Speed
#1
Hi,

I have programmed a game involving a tkinter canvas of 900x900,
divided into 60x60 cells of different colors.
To show each new situation, it takes some time (seconds),
and tests proved that updating the canvas takes more than half of that time.
So the question is, can i find a faster update mechanism than the one i implemented:
cell_size is obviously 15 pixels.(i also think cell size has no influence or very little)
def new_gen():
    for row in range(60):
        for col in range(60):
            y = row * cell_size
            x = col * cell_size
            Kanvas.create_rectangle(x,y,x+cell_size,y+cell_size,fill='somecolor')
    root.update()
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
GUI Speed - by DPaul - Jul-20-2020, 07:49 AM
RE: GUI Speed - by deanhystad - Jul-20-2020, 01:59 PM
RE: GUI Speed - by DPaul - Jul-20-2020, 02:50 PM
RE: GUI Speed - by deanhystad - Jul-20-2020, 06:25 PM
RE: GUI Speed - by DPaul - Jul-21-2020, 06:38 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020