Adding in the Canvas

Now that we have our buttons in place, we are now going to add in our canvas. Unlike the Buttons, we will want the Canvas to fill up as much space as possible, expanding in both directions if the size of the window changes.

First, let’s create a canvas widget, named drawing, and place it inside of the right frame

drawing = Canvas(rightFrame)

Then, pack it into place, making sure that the “fill” attribute is set to “BOTH” and the expand attribute is set to “True”.

drawing.pack(fill=BOTH, expand=True)

At this point, we have done a lot of coding, so the next section we’ll look over everything and make sure that we are all set to continue onward.