Python Forum
[Tkinter] Canvas animation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Canvas animation
#1
I've been working on a simple tkinter app that has various widgets, I've done some entries, a button, some radiobuttons and so on...all I have left is to make an animation in canvas.

I make the arc, but I don't know how to do animations on it.

The animation should start automatically when the code is run and keep going until a certain radio button is selected and a button pressed, when I press the button it should do a backward-animation and stop.

To be more specific - there is only one button that does different things based on which radio button is selected.

Here is the video of how the animation should look: https://streamable.com/7w2dxe

Here is the code:
c = tkinter.Canvas(root, bg='yellow', height=150, width=300)
coord = 60, 60, 240, 210
arc = c.create_arc(coord, start=0, extent=180, fill='red')
c.pack(expand=True, fill='both')

stop_anim = Radiobutton(root, text='STOP ANIMATION', variable=var, value=2).pack(anchor=W)

do_it_button = Button(root, text='DO IT!', bg='limegreen', command=functions).pack(expand=True, fill='both')
I made the arc (to almost match the one on the video), but I can't seem to make that line do the animation and then stop on a click of the button.

Any help will be appreciated!
Reply
#2
This will get you started: http://effbot.org/zone/tkinter-animation.htm
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Resizing image inside Canvas (with Canvas' resize) Gupi 2 25,089 Jun-04-2019, 05:05 AM
Last Post: Gupi

Forum Jump:

User Panel Messages

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