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

Module bigwidgets

source code

Tools for graphically displaying and interacting with the objects and processing classes defined by the Toolkit. These tools are primarily intended to help students visualize the objects that they create.

The graphical tools are typically built using canvas widgets, each of which encapsulates the graphical elements and bindings used to display a complex object on a Tkinter Canvas. For example, NLTK defines canvas widgets for displaying trees and directed graphs, as well as a number of simpler widgets. These canvas widgets make it easier to build new graphical tools and demos. See the class documentation for CanvasWidget for more information.

The nltk.draw module defines the abstract CanvasWidget base class, and a number of simple canvas widgets. The remaining canvas widgets are defined by submodules, such as nltk.draw.tree.

The nltk.draw module also defines CanvasFrame, which encapsulates a Canvas and its scrollbars. It uses a ScrollWatcherWidget to ensure that all canvas widgets contained on its canvas are within the scroll region.

Acknowledgements: Many of the ideas behind the canvas widget system are derived from CLIG, a Tk-based grapher for linguistic data structures. For more information, see the CLIG homepage at:

   http://www.ags.uni-sb.de/~konrad/clig.html
Classes [hide private]
  CanvasWidget
A collection of graphical elements and bindings used to display a complex object on a Tkinter Canvas.
  TextWidget
A canvas widget that displays a single string of text.
  SymbolWidget
A canvas widget that displays special symbols, such as the negation sign and the exists operator.
  AbstractContainerWidget
An abstract class for canvas widgets that contain a single child, such as CanvasBox and CanvasOval.
  BoxWidget
A canvas widget that places a box around a child widget.
  PolygonWidget
A canvas widget that places a box around a child widget.
  OvalWidget
A canvas widget that places a oval around a child widget.
  ImageWidget
A canvas widget that contains an image widget.
  ParenWidget
A canvas widget that places a pair of parenthases around a child widget.
  BracketWidget
A canvas widget that places a pair of brackets around a child widget.
  SequenceWidget
A canvas widget that keeps a list of canvas widgets in a horizontal line.
  StackWidget
A canvas widget that keeps a list of canvas widgets in a vertical line.
  SpaceWidget
A canvas widget that takes up space but does not display anything.
  ScrollWatcherWidget
A special canvas widget that adjusts its Canvas's scrollregion to always include the bounding boxes of all of its children.
  CanvasFrame
A Tkinter frame containing a canvas and scrollbars.
  ShowText
A Tkinter window used to display a text.
Functions [hide private]
 
odemo(root=None)
A simple demonstration showing how to use canvas widgets.
source code
Variables [hide private]
  ACTIVE = 'active'
  ALL = 'all'
  ANCHOR = 'anchor'
  ARC = 'arc'
  BASELINE = 'baseline'
  BEVEL = 'bevel'
  BOTH = 'both'
  BOTTOM = 'bottom'
  BROWSE = 'browse'
  BUTT = 'butt'
  CASCADE = 'cascade'
  CENTER = 'center'
  CHAR = 'char'
  CHECKBUTTON = 'checkbutton'
  CHORD = 'chord'
  COMMAND = 'command'
  CURRENT = 'current'
  DISABLED = 'disabled'
  DOTBOX = 'dotbox'
  E = 'e'
  END = 'end'
  EW = 'ew'
  EXCEPTION = 8
  EXTENDED = 'extended'
  FALSE = 0
  FIRST = 'first'
  FLAT = 'flat'
  GROOVE = 'groove'
  HIDDEN = 'hidden'
  HORIZONTAL = 'horizontal'
  INSERT = 'insert'
  INSIDE = 'inside'
  LAST = 'last'
  LEFT = 'left'
  MITER = 'miter'
  MOVETO = 'moveto'
  MULTIPLE = 'multiple'
  N = 'n'
  NE = 'ne'
  NO = 0
  NONE = 'none'
  NORMAL = 'normal'
  NS = 'ns'
  NSEW = 'nsew'
  NUMERIC = 'numeric'
  NW = 'nw'
  OFF = 0
  ON = 1
  OUTSIDE = 'outside'
  PAGES = 'pages'
  PIESLICE = 'pieslice'
  PROJECTING = 'projecting'
  RADIOBUTTON = 'radiobutton'
  RAISED = 'raised'
  READABLE = 2
  RIDGE = 'ridge'
  RIGHT = 'right'
  ROUND = 'round'
  S = 's'
  SCROLL = 'scroll'
  SE = 'se'
  SEL = 'sel'
  SEL_FIRST = 'sel.first'
  SEL_LAST = 'sel.last'
  SEPARATOR = 'separator'
  SINGLE = 'single'
  SOLID = 'solid'
  SUNKEN = 'sunken'
  SW = 'sw'
  StringTypes = (<type 'str'>, <type 'unicode'>)
  TOP = 'top'
  TRUE = 1
  TclVersion = 8.4
  TkVersion = 8.4
  UNDERLINE = 'underline'
  UNITS = 'units'
  VERTICAL = 'vertical'
  W = 'w'
  WORD = 'word'
  WRITABLE = 4
  X = 'x'
  Y = 'y'
  YES = 1
  wantobjects = 1