Package teamwork :: Package widgets :: Module bigwidgets :: Class ScrollWatcherWidget
[hide private]
[frames] | no frames]

Class ScrollWatcherWidget

source code

CanvasWidget --+
               |
              ScrollWatcherWidget

A special canvas widget that adjusts its Canvas's scrollregion to always include the bounding boxes of all of its children. The scroll-watcher widget will only increase the size of the Canvas's scrollregion; it will never decrease it.

Instance Methods [hide private]
 
__init__(self, canvas, *children, **attribs)
Create a new scroll-watcher widget.
source code
None
add_child(self, canvaswidget)
Add a new canvas widget to the scroll-watcher.
source code
None
remove_child(self, canvaswidget)
Remove a canvas widget from the scroll-watcher.
source code
list of int
_tags(self)
Returns: a list of canvas tags for all graphical elements managed by this canvas widget, not including graphical elements managed by its child widgets.
source code
None
_update(self, child)
Update this canvas widget in response to a change in one of its children.
source code
 
_adjust_scrollregion(self)
Adjust the scrollregion of this scroll-watcher's Canvas to include the bounding boxes of all of its children.
source code

Inherited from CanvasWidget: __getitem__, __repr__, __setitem__, bbox, bind_click, bind_drag, canvas, child_widgets, destroy, height, hidden, hide, manage, move, parent, show, tags, unbind_click, unbind_drag, update, width

Method Details [hide private]

__init__(self, canvas, *children, **attribs)
(Constructor)

source code 

Create a new scroll-watcher widget.

Parameters:
  • canvas (Tkinter.Canvas) - This canvas widget's canvas.
  • children (list of CanvasWidget) - The canvas widgets watched by the scroll-watcher. The scroll-watcher will ensure that these canvas widgets are always contained in their canvas's scrollregion.
  • attribs - The new canvas widget's attributes.
Overrides: CanvasWidget.__init__

add_child(self, canvaswidget)

source code 

Add a new canvas widget to the scroll-watcher. The scroll-watcher will ensure that the new canvas widget is always contained in its canvas's scrollregion.

Parameters:
  • canvaswidget (CanvasWidget) - The new canvas widget.
Returns: None

remove_child(self, canvaswidget)

source code 

Remove a canvas widget from the scroll-watcher. The scroll-watcher will no longer ensure that the new canvas widget is always contained in its canvas's scrollregion.

Parameters:
  • canvaswidget (CanvasWidget) - The canvas widget to remove.
Returns: None

_tags(self)

source code 
Returns: list of int
a list of canvas tags for all graphical elements managed by this canvas widget, not including graphical elements managed by its child widgets.
Overrides: CanvasWidget._tags
(inherited documentation)

_update(self, child)

source code 

Update this canvas widget in response to a change in one of its children.

Parameters:
  • child - The child that changed.
Returns: None
Overrides: CanvasWidget._update
(inherited documentation)