class documentation

A canvas widget that keeps a list of canvas widgets in a horizontal line.

Attributes:
  • align: The vertical alignment of the children. Possible values are 'top', 'center', and 'bottom'. By default, children are center-aligned.
  • space: The amount of horizontal space to place between children. By default, one pixel of space is used.
  • ordered: If true, then keep the children in their original order.
Method __getitem__ No summary
Method __init__ Create a new sequence widget.
Method __repr__ No summary
Method __setitem__ Set the value of the attribute attr to value. See the class documentation for a list of attributes supported by this canvas widget.
Method insert_child Insert a child canvas widget before a given index.
Method remove_child Remove the given child canvas widget. child's parent will be set ot None.
Method replace_child Replace the child canvas widget oldchild with newchild. newchild must not have a parent. oldchild's parent will be set to None.
Method _manage Arrange the child widgets of this canvas widget. This method is called when the canvas widget is initially created. It is also called if the user calls the manage method on this canvas widget or any of its ancestors.
Method _tags No summary
Method _update Update this canvas widget in response to a change in one of its children.
Method _yalign Undocumented
Instance Variable _align Undocumented
Instance Variable _children Undocumented
Instance Variable _ordered Undocumented
Instance Variable _space Undocumented

Inherited from CanvasWidget:

Method bbox No summary
Method bind_click Register a new callback that will be called whenever this CanvasWidget is clicked on.
Method bind_drag Register a new callback that will be called after this CanvasWidget is dragged. This implicitly makes this CanvasWidget draggable.
Method canvas No summary
Method child_widgets No summary
Method destroy Remove this CanvasWidget from its Canvas. After a CanvasWidget has been destroyed, it should not be accessed.
Method height No summary
Method hidden No summary
Method hide Temporarily hide this canvas widget.
Method manage Arrange this canvas widget and all of its descendants.
Method move Move this canvas widget by a given distance. In particular, shift the canvas widget right by dx pixels, and down by dy pixels. Both dx and dy may be negative, resulting in leftward or upward movement.
Method moveto Move this canvas widget to the given location. In particular, shift the canvas widget such that the corner or side of the bounding box specified by anchor is at location (x, y).
Method parent No summary
Method show Show a hidden canvas widget.
Method tags No summary
Method unbind_click Remove a callback that was registered with bind_click.
Method unbind_drag Remove a callback that was registered with bind_drag.
Method update Update the graphical display of this canvas widget, and all of its ancestors, in response to a change in one of this canvas widget's children.
Method width No summary
Method __click If this CanvasWidget has a drag callback, then call it; otherwise, find the closest ancestor with a click callback, and call it. If no ancestors have a click callback, do nothing.
Method __drag If this CanvasWidget has a drag callback, then call it; otherwise, find the closest ancestor with a drag callback, and call it. If no ancestors have a drag callback, do nothing.
Method __motion_cb move this object to the new location
Method __press_cb record the button press event in self.__press
Method __release_cb unregister motion & button release callbacks.
Method __start_drag register a motion callback
Method _add_child_widget Register a hierarchical child widget. The child will be considered part of this canvas widget for purposes of user interaction. _add_child_widget has two direct effects:
Method _remove_child_widget Remove a hierarchical child widget. This child will no longer be considered part of this canvas widget for purposes of user interaction. _add_child_widget has two direct effects:
Instance Variable __callbacks Registered callbacks. Currently, four keys are used: 1, 2, 3, and 'drag'. The values are callback functions. Each callback function takes a single argument, which is the CanvasWidget that triggered the callback.
Instance Variable __canvas This CanvasWidget's canvas.
Instance Variable __children This CanvasWidget's hierarchical child widgets.
Instance Variable __drag_x Where it's been moved to (to find dx)
Instance Variable __drag_y Where it's been moved to (to find dy)
Instance Variable __draggable Is this canvas widget draggable?
Instance Variable __hidden Undocumented
Instance Variable __parent This CanvasWidget's hierarchical parent widget.
Instance Variable __press The ButtonPress event that we're currently handling.
Instance Variable __updating Is this canvas widget currently performing an update? If it is, then it will ignore any new update requests from child widgets.
def __getitem__(self, attr): (source)
Returns
(any)the value of the attribute attr. See the class documentation for a list of attributes supported by this canvas widget.
def __init__(self, canvas, *children, **attribs): (source)

Create a new sequence widget.

Parameters
canvas:Tkinter.CanvasThis canvas widget's canvas.
*children:list(CanvasWidget)The widgets that should be aligned horizontally. Each child must not have a parent.
**attribsThe new canvas widget's attributes.
def __repr__(self): (source)
Returns
stra string representation of this canvas widget.
def __setitem__(self, attr, value): (source)

Set the value of the attribute attr to value. See the class documentation for a list of attributes supported by this canvas widget.

Returns
NoneUndocumented
def insert_child(self, index, child): (source)

Insert a child canvas widget before a given index.

Parameters
index:intThe index where the child widget should be inserted. In particular, the index of child will be index; and the index of any children whose indices were greater than equal to index before child was inserted will be incremented by one.
child:CanvasWidgetThe canvas widget that should be inserted.
def remove_child(self, child): (source)

Remove the given child canvas widget. child's parent will be set ot None.

Parameters
child:CanvasWidgetThe child canvas widget to remove.
def replace_child(self, oldchild, newchild): (source)

Replace the child canvas widget oldchild with newchild. newchild must not have a parent. oldchild's parent will be set to None.

Parameters
oldchild:CanvasWidgetThe child canvas widget to remove.
newchild:CanvasWidgetThe canvas widget that should replace oldchild.
def _manage(self): (source)

Arrange the child widgets of this canvas widget. This method is called when the canvas widget is initially created. It is also called if the user calls the manage method on this canvas widget or any of its ancestors.

Returns
NoneUndocumented
def _tags(self): (source)
Returns
list of inta list of canvas tags for all graphical elements managed by this canvas widget, not including graphical elements managed by its child widgets.
def _update(self, child): (source)

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

Parameters
child:CanvasWidgetThe child that changed.
Returns
NoneUndocumented
def _yalign(self, top, bot): (source)

Undocumented

Undocumented

_children = (source)

Undocumented

_ordered: bool = (source)

Undocumented

_space: int = (source)

Undocumented