Canvas Bbox Method Returns None Although Widgets Exist Inside
In tkinter, I'm trying to make a scrollable canvas that contains widgets so my fixed-size window can scroll to use all the widgets. However, when attempting to set the scrollbar si
Solution 1:
The bbox
method will return a bounding box only for canvas items. If you add a label to the canvas with grid
, it's not a canvas items. You must use one of the methods (create_line
, create_window
, etc) to add an object to the canvas.
(Note that bbox
will return it will show (0, 0, 0, 0) until anything added to the canvas is actually visible on the screen. You need to reset the scroll region either after calling update, or waiting for something like a <Configure>
event.)
Post a Comment for "Canvas Bbox Method Returns None Although Widgets Exist Inside"