This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman.
It was last updated in 2013 and is unmaintained. [More info]
You can place any Tkinter widget onto a canvas by using a canvas window object. A window is a rectangular area that can hold one Tkinter widget. The widget must be the child of the same top-level window as the canvas, or the child of some widget located in the same top-level window.
If you want to put complex multi-widget objects on a
canvas, you can use this method to place a
Frame widget on the canvas, and then place other
widgets inside that frame.
To create a new canvas window object on a canvas
This returns the object ID for the window object. Options include:
Canvas window options
The default is |
|The height of the area reserved for the window. If omitted, the window will be sized to fit the height of the contained widget. See Section 5.1, “Dimensions” for possible values.|
By default, window items are in the |
If a single string, the window is tagged with
that string. Use a tuple of strings to tag the
window with multiple tags. See Section 8.4, “|
|The width of the area reserved for the window. If omitted, the window will be sized to fit the width of the contained widget.|