Package nltk :: Package draw :: Class SequenceWidget
[hide private]
[frames] | no frames]

Class SequenceWidget

source code

  object --+    
           |    
CanvasWidget --+
               |
              SequenceWidget

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

Attributes:

Instance Methods [hide private]
(any)
__getitem__(self, attr)
Returns: the value of the attribute attr.
source code
 
__init__(self, canvas, *children, **attribs)
Create a new sequence widget.
source code
string
__repr__(self)
Returns: a string representation of this canvas widget.
source code
None
__setitem__(self, attr, value)
Set the value of the attribute attr to value.
source code
None
_manage(self)
Arrange the child widgets of this canvas widget.
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
 
_yalign(self, top, bot) source code
list of CanvasWidget
children(self)
Returns: A list of the hierarchical children of this canvas widget.
source code
 
insert_child(self, index, child)
Insert a child canvas widget before a given index.
source code
 
remove_child(self, child)
Remove the given child canvas widget.
source code
 
replace_child(self, oldchild, newchild)
Replace the child canvas widget oldchild with newchild.
source code

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

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getitem__(self, attr)
(Indexing operator)

source code 
Returns: (any)
the value of the attribute attr. See the class documentation for a list of attributes supported by this canvas widget.
Overrides: CanvasWidget.__getitem__
(inherited documentation)

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

source code 

Create a new sequence widget.

Parameters:
  • canvas (Tkinter.Canvas) - This canvas widget's canvas.
  • children (list of CanvasWidget) - The widgets that should be aligned horizontally. Each child must not have a parent.
  • attribs - The new canvas widget's attributes.
Overrides: CanvasWidget.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Returns: string
a string representation of this canvas widget.
Overrides: CanvasWidget.__repr__
(inherited documentation)

__setitem__(self, attr, value)
(Index assignment operator)

source code 

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

Returns: None
Overrides: CanvasWidget.__setitem__
(inherited documentation)

_manage(self)

source code 

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: None
Overrides: CanvasWidget._manage
(inherited documentation)

_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)

children(self)

source code 
Returns: list of CanvasWidget
A list of the hierarchical children of this canvas widget. These children are considered part of self for purposes of user interaction.

insert_child(self, index, child)

source code 

Insert a child canvas widget before a given index.

Parameters:
  • child (CanvasWidget) - The canvas widget that should be inserted.
  • index (int) - The 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.

remove_child(self, child)

source code 

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

Parameters:
  • child (CanvasWidget) - The child canvas widget to remove.

replace_child(self, oldchild, newchild)

source code 

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

Parameters:
  • oldchild (CanvasWidget) - The child canvas widget to remove.
  • newchild (CanvasWidget) - The canvas widget that should replace oldchild.