Home > Enterprise >  Difference between Frame and Canvas tkinter?
Difference between Frame and Canvas tkinter?

Time:06-01

What is the difference between a Frame and Canvas in tkinter? I'm a beginner in tkinter, and I don't really see any difference between the two... I've been using them interchangeably. Are they the same or is there some sort of internal or external difference?

CodePudding user response:

A Frame is designed to be a container for other widgets. It really doesn't do anything but provide a border and color, and to collect a set of widgets into a logical group.

A Canvas is something that can act as a container for other widgets (as can just about any widget), but it also has features that let you draw circles, lines, rectangles, and other objects on it.

A Canvas can also be scrolled, whereas a frame cannot.

  • Related