A Tkinter frame containing a canvas and scrollbars. CanvasFrame uses a ScrollWatcherWidget to ensure that all of the canvas widgets contained on its canvas are within its scrollregion. In order for CanvasFrame to make these checks, all canvas widgets must be registered with add_widget when they are added to the canvas; and destroyed with destroy_widget when they are no longer needed.
If a CanvasFrame is created with no parent, then it will create its own main window, including a "Done" button and a "Print" button.
Method | __init__ |
Create a new CanvasFrame. |
Method | add |
Register a canvas widget with this CanvasFrame. The CanvasFrame will ensure that this canvas widget is always within the Canvas's scrollregion. If no coordinates are given for the canvas widget, then the ... |
Method | canvas |
No summary |
Method | destroy |
Destroy this CanvasFrame. If this CanvasFrame created a top-level window, then this will close that window. |
Method | destroy |
Remove a canvas widget from this CanvasFrame. This deregisters the canvas widget, and destroys it. |
Method | mainloop |
Enter the Tkinter mainloop. This function must be called if this frame is created from a non-interactive program (e.g. from a secript); otherwise, the frame will close as soon as the script completes. |
Method | pack |
Pack this CanvasFrame. See the documentation for Tkinter.Pack for more information. |
Method | print |
Print the contents of this CanvasFrame to a postscript file. If no filename is given, then prompt the user for one. |
Method | remove |
Undocumented |
Method | scrollregion |
No summary |
Method | _find |
Try to find a space for a given widget. |
Method | _init |
Undocumented |
Instance Variable | _canvas |
Undocumented |
Instance Variable | _frame |
Undocumented |
Instance Variable | _parent |
Undocumented |
Instance Variable | _scrollwatcher |
Undocumented |
Create a new CanvasFrame.
Parameters | |
parent:Tkinter.BaseWidget or Tkinter.Tk | The parent Tkinter widget. If no parent is specified, then CanvasFrame will create a new main window. |
**kw | Keyword arguments for the new Canvas. See the documentation for Tkinter.Canvas for more information. |
Register a canvas widget with this CanvasFrame. The CanvasFrame will ensure that this canvas widget is always within the Canvas's scrollregion. If no coordinates are given for the canvas widget, then the CanvasFrame will attempt to find a clear area of the canvas for it.
Parameters | |
canvaswidget:CanvasWidget | The new canvas widget. canvaswidget must have been created on this CanvasFrame's canvas. |
x:int | The initial x coordinate for the upper left hand corner of canvaswidget, in the canvas's coordinate space. |
y:int | The initial y coordinate for the upper left hand corner of canvaswidget, in the canvas's coordinate space. |
Destroy this CanvasFrame. If this CanvasFrame created a top-level window, then this will close that window.
Enter the Tkinter mainloop. This function must be called if this frame is created from a non-interactive program (e.g. from a secript); otherwise, the frame will close as soon as the script completes.
Print the contents of this CanvasFrame to a postscript file. If no filename is given, then prompt the user for one.
Parameters | |
filename:str | The name of the file to print the tree to. |
Returns | |
None | Undocumented |