TKinter Drawing

TKinter can be used to draw simple shapes e.g. Square, Polygons, and Circles.

Tkinter Events

Tkinter employs a type of programming called Event-Driven which means that the program runs in a endless loop waiting for things (events) to happen.  In order for the program to respond to these events it needs to know what to listen for.  

TKinter Images

You can attach images to the canvas with welcomeGif = PhotoImage(file = ‘./images/welcome.gif’)canvas.create_image(canvas_width/2,canvas_height/2, image=welcomeGif) Where the example image is located in a image subfolder of the program with type gif. If you wanted to change the image to another type during the execution of the program you would need to use a slightly different initial …

Tkinter Text

You can add text to a TKinter canvas with the following code titletext = canvas.create_text(10, 10, anchor=”nw”, fill=”red”) This creates a canvas text object with the name title text in the colour of red.  The text is anchored by its North West corner so the top left corner of the text will be positioned at position …

Tkinter GIFS

This python class provides an easy way to include animated gifs on a TKinter canvas.