scitools.Lumpy

UML diagrams for Python

Lumpy generates UML diagrams (currently object and class diagrams) from a running Python program. It is similar to a graphical debugger in the sense that it generates a visualization of the state of a running program, but it is different from a debugger in the sense that it tries to generate high-level visualizations that are compliant (at least in spirit) with standard UML.

There are three target audiences for this module: teachers, students and software engineers. Teachers can use Lumpy to generate figures that demonstrate a model of the execution of a Python program. Students can use Lumpy to explore the behavior of the Python interpreter. Software engineers can use Lumpy to extract the structure of existing programs by diagramming the relationships among the classes, including classes defined in libraries and the Python interpreter.

Copyright 2005 Allen B. Downey

This file contains wrapper classes I use with tkinter. It is mostly for my own use; I don’t support it, and it is not very well documented.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/gpl.html or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

class scitools.Lumpy.Binding(lumpy, key, val)[source]

Bases: scitools.Lumpy.Thing

the graphical representation of the binding between a key and a value.

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
draw_key(diag, p, flip, tags) draw a reference to a previously-drawn key rather
drawme(diag, pos, flip[, tags])
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
rebind(val)
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'rebind': <function rebind at 0x50ea7d0>, '__module__': 'scitools.Lumpy', 'drawme': <function drawme at 0x50ea8c0>, 'draw_key': <function draw_key at 0x50ea848>, '__init__': <function __init__ at 0x50ea758>, '__doc__': 'the graphical representation of the binding between a\n key and a value.\n '})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, key, val)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

draw_key(diag, p, flip, tags)[source]

draw a reference to a previously-drawn key rather than drawing the key inside the mapping.

drawme(diag, pos, flip, tags=())[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

rebind(val)[source]
set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Class(lumpy, classobj)[source]

Bases: scitools.Lumpy.Instance

a graphical representation of a Class. It inherits from Instance, which controls how a Class appears in an object diagram, and contains a ClassDiagramClass, which controls how the Class appears in a class diagram.

Methods

add_child(child) when a subclass is created, it notifies its parent
add_hasa(child[, n]) increment the number of references we have found
add_ivar(var) add to the set of instance variables for this class
bbox() the bbox of a Mapping is the bbox of its box item.
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags]) drawme is the middle part of the way objects are drawn.
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
scan_bindings(cls) scan the bindings in this Instance, looking for
scan_val(cls, val) if we find a reference to an object type, make a note
set_depth() compute the maximum depth between this class and
set_height() compute the maximum height between this class and
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', 'set_height': <function set_height at 0x50ea488>, 'add_ivar': <function add_ivar at 0x50ea578>, 'set_depth': <function set_depth at 0x50ea500>, 'add_hasa': <function add_hasa at 0x50ea410>, 'add_child': <function add_child at 0x50ea398>, '__doc__': 'a graphical representation of a Class. It inherits\n from Instance, which controls how a Class appears in an\n object diagram, and contains a ClassDiagramClass, which\n controls how the Class appears in a class diagram.\n ', '__init__': <function __init__ at 0x50ea320>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, classobj)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

add_child(child)[source]

when a subclass is created, it notifies its parent classes, who update their list of children

add_hasa(child, n=1)[source]

increment the number of references we have found from this class to the given child class

add_ivar(var)[source]

add to the set of instance variables for this class

bbox()

the bbox of a Mapping is the bbox of its box item. This is different from other Things.

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())

drawme is the middle part of the way objects are drawn. Thing.draw does some prep work, invokes drawme, and then does some cleanup. draw and drawme are not allowed to modify pos.

isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

scan_bindings(cls)

scan the bindings in this Instance, looking for references to other object types; also, make a note of the names of the instance variables. cls is the Class object this instance belongs to.

scan_val(cls, val)

if we find a reference to an object type, make a note of the HAS-A relationship. If we find a reference to a container type, scan it for references.

set_depth()[source]

compute the maximum depth between this class and a root class (one with no parents)

set_height()[source]

compute the maximum height between this class and a leaf class (one with no children)

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.ClassDiagram(lumpy, classes=None)[source]

Bases: scitools.Lumpy.Diagram

Methods

add_arrow(arrow) append a new arrow on the list
ca(*args, **options) make a canvas for the diagram
close() close the window and exit
draw() draw the class diagram, including the classes in self.classes,
draw_arrows() draw all the arrows on the list
draw_classes(classes, pos[, tags]) draw this list of classes and all their subclasses,
printfile() dump the contents of the canvas to the filename in the
setup() create the gui for the diagram
update_arrows([n]) update up to n arrows (or all of them is n==None)
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', 'draw_classes': <function draw_classes at 0x55510c8>, 'draw': <function draw at 0x5551050>, '__init__': <function __init__ at 0x50e8f50>, '__doc__': None})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, classes=None)[source]
__module__ = 'scitools.Lumpy'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

add_arrow(arrow)

append a new arrow on the list

ca(*args, **options)

make a canvas for the diagram

close()

close the window and exit

draw()[source]

draw the class diagram, including the classes in self.classes, or if there are none, then all the classes Lumpy has seen.

draw_arrows()

draw all the arrows on the list

draw_classes(classes, pos, tags=())[source]

draw this list of classes and all their subclasses, starting at the given position. Return a list of all classes drawn.

printfile()

dump the contents of the canvas to the filename in the filename entry.

setup()

create the gui for the diagram

update_arrows(n=None)

update up to n arrows (or all of them is n==None)

class scitools.Lumpy.ClassDiagramClass(lumpy, classobj)[source]

Bases: scitools.Lumpy.Thing

a graphical representation of a Class as it appears in a Class Diagram (which is different from the way class objects appear in Object Diagrams).

Methods

arrow_head(diag, bbox, tags[, size]) draw the hollow arrow head that connects this class
bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags])
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__init__': <function __init__ at 0x50ea5f0>, '__module__': 'scitools.Lumpy', 'arrow_head': <function arrow_head at 0x50ea6e0>, 'drawme': <function drawme at 0x50ea668>, '__doc__': 'a graphical representation of a Class as it appears\n in a Class Diagram (which is different from the way class\n objects appear in Object Diagrams).\n '})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, classobj)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

arrow_head(diag, bbox, tags, size=0.5)[source]

draw the hollow arrow head that connects this class to its children.

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.ContainsArrow(lumpy, parent, child, **options)[source]

Bases: scitools.Lumpy.Thing

a contains arrow, which shows a has-a relationship between classes in a class diagram.

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag)
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
update()
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'draw': <function draw at 0x50eac80>, 'update': <function update at 0x50eacf8>, '__module__': 'scitools.Lumpy', '__init__': <function __init__ at 0x50eac08>, '__doc__': 'a contains arrow, which shows a has-a relationship between\n classes in a class diagram.\n '})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, parent, child, **options)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag)[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

update()[source]
class scitools.Lumpy.DiagCanvas(w, transforms=None, **options)[source]

Bases: scitools._Gui.GuiCanvas

a Canvas for displaying Diagrams

Methods

add_transform(transform[, index]) add the given transform at the given index in the
addtag(*args) Internal function.
addtag_above(newtag, tagOrId) Add tag NEWTAG to all items above TAGORID.
addtag_all(newtag) Add tag NEWTAG to all items.
addtag_below(newtag, tagOrId) Add tag NEWTAG to all items below TAGORID.
addtag_closest(newtag, x, y[, halo, start]) Add tag NEWTAG to item which is closest to pixel at X, Y.
addtag_enclosed(newtag, x1, y1, x2, y2) Add tag NEWTAG to all items in the rectangle defined
addtag_overlapping(newtag, x1, y1, x2, y2) Add tag NEWTAG to all items which overlap the rectangle
addtag_withtag(newtag, tagOrId) Add tag NEWTAG to all items with TAGORID.
after(ms[, func]) Call function once after given time.
after_cancel(id) Cancel scheduling of function identified with ID.
after_idle(func, *args) Call FUNC once if the Tcl main loop has no event to
arrow(start, end, **options) draw an arrow: start and end can be a Pos object or
bbox(item) compute the bounding box of the given item
bell([displayof]) Ring a display’s bell.
bind([sequence, func, add]) Bind to this widget at event SEQUENCE a call to function FUNC.
bind_all([sequence, func, add]) Bind to all widgets at an event SEQUENCE a call to function FUNC.
bind_class(className[, sequence, func, add]) Bind to widgets with bindtag CLASSNAME at event
bindtags([tagList]) Set or get the list of bindtags for this widget.
box(box[, padx, pady]) draw a rectangle with the given bounding box, expanded
canvasx(screenx[, gridspacing]) Return the canvas x coordinate of pixel position SCREENX rounded
canvasy(screeny[, gridspacing]) Return the canvas y coordinate of pixel position SCREENY rounded
cget(key) Return the resource value for a KEY given as string.
circle(x, y, r[, fill]) make a circle with center at (x, y) and radius (r)
clipboard_append(string, **kw) Append STRING to the Tk clipboard.
clipboard_clear(**kw) Clear the data in the Tk clipboard.
clipboard_get(**kw) Retrieve data from the clipboard on window’s display.
colormodel([value]) Useless.
columnconfigure(index[, cnf]) Configure column INDEX of a grid.
config([cnf]) Configure resources of a widget.
configure([cnf]) Configure resources of a widget.
coords(*args) Return a list of coordinates for the item given in ARGS.
create_arc(*args, **kw) Create arc shaped region with coordinates x1,y1,x2,y2.
create_bitmap(*args, **kw) Create bitmap with coordinates x1,y1.
create_image(*args, **kw) Create image item with coordinates x1,y1.
create_line(*args, **kw) Create line with coordinates x1,y1,...,xn,yn.
create_oval(*args, **kw) Create oval with coordinates x1,y1,x2,y2.
create_polygon(*args, **kw) Create polygon with coordinates x1,y1,...,xn,yn.
create_rectangle(*args, **kw) Create rectangle with coordinates x1,y1,x2,y2.
create_text(*args, **kw) Create text with coordinates x1,y1.
create_window(*args, **kw) Create window with coordinates x1,y1,x2,y2.
dchars(*args) Delete characters of text items identified by tag or id in ARGS (possibly
delete(*args) Delete items identified by all tag or ids contained in ARGS.
deletecommand(name) Internal function.
destroy() Destroy this and all descendants widgets.
dot(pos[, r]) draw a dot at the given position with radius r
dtag(*args) Delete tag or id given as last arguments in ARGS from items
dump([filename]) create a PostScipt file with the given name and dump
event_add(virtual, *sequences) Bind a virtual event VIRTUAL (of the form <<Name>>)
event_delete(virtual, *sequences) Unbind a virtual event VIRTUAL from SEQUENCE.
event_generate(sequence, **kw) Generate an event SEQUENCE. Additional
event_info([virtual]) Return a list of all virtual events or the information
find(*args) Internal function.
find_above(tagOrId) Return items above TAGORID.
find_all() Return all items.
find_below(tagOrId) Return all items below TAGORID.
find_closest(x, y[, halo, start]) Return item which is closest to pixel at X, Y.
find_enclosed(x1, y1, x2, y2) Return all items in rectangle defined
find_overlapping(x1, y1, x2, y2) Return all items which overlap the rectangle
find_withtag(tagOrId) Return all items with TAGORID.
flipx(item) warning: this works in pixel coordinates
focus(*args) Set focus to the first item specified in ARGS.
focus_displayof() Return the widget which has currently the focus on the display where this widget is located.
focus_force() Direct input focus to this widget even if the application does not have the focus.
focus_get() Return the widget which has currently the focus in the application.
focus_lastfor() Return the widget which would have the focus if top level
focus_set() Direct input focus to this widget.
forget() Unmap this widget and do not use it for the packing order.
getboolean(s) Return a boolean value for Tcl boolean values true and false given as parameter.
getdouble
getint
gettags(*args) Return tags associated with the first item specified in ARGS.
getvar([name]) Return value of Tcl variable NAME.
grab_current() Return widget which has currently the grab in this application
grab_release() Release grab for this widget if currently set.
grab_set() Set grab for this widget.
grab_set_global() Set global grab for this widget.
grab_status() Return None, “local” or “global” if this widget has
grid([cnf]) Position a widget in the parent widget in a grid.
grid_bbox([column, row, col2, row2]) Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid.
grid_columnconfigure(index[, cnf]) Configure column INDEX of a grid.
grid_configure([cnf]) Position a widget in the parent widget in a grid.
grid_forget() Unmap this widget.
grid_info() Return information about the options
grid_location(x, y) Return a tuple of column and row which identify the cell
grid_propagate([flag]) Set or get the status for propagation of geometry information.
grid_remove() Unmap this widget but remember the grid options.
grid_rowconfigure(index[, cnf]) Configure row INDEX of a grid.
grid_size() Return a tuple of the number of column and rows in the grid.
grid_slaves([row, column]) Return a list of all slaves of this widget
icursor(*args) Set cursor at position POS in the item identified by TAGORID.
image(coord, image, **options) make an image item with the given image at the given position.
image_names() Return a list of all existing image names.
image_types() Return a list of all available image types (e.g.
index(*args) Return position of cursor as integer in item specified in ARGS.
info() Return information about the packing options
insert(*args) Insert TEXT in item TAGORID at position POS. ARGS must
invert(coords) apply the inverse of each of the transforms, in reverse
itemcget(tagOrId, option) Return the resource value for an OPTION for item TAGORID.
itemconfig(tagOrId[, cnf]) Configure resources of an item TAGORID.
itemconfigure(tagOrId[, cnf]) Configure resources of an item TAGORID.
keys() Return a list of all resource names of this widget.
lift(*args) Raise an item TAGORID given in ARGS
line(coords[, fill]) make a polyline with vertices at each point in (coords)
location(x, y) Return a tuple of column and row which identify the cell
lower(*args) Lower an item TAGORID given in ARGS
mainloop([n]) Call the mainloop of Tk.
measure(t, **options) find the bounding box of the list of words by
move(*args) Move an item TAGORID given in ARGS.
nametowidget(name) Return the Tkinter instance of a widget identified by
option_add(pattern, value[, priority]) Set a VALUE (second parameter) for an option
option_clear() Clear the option database.
option_get(name, className) Return the value for an option NAME for this widget
option_readfile(fileName[, priority]) Read file FILENAME into the option database.
oval(coords[, fill]) make an oval with bounding box (coords) and fill color (fill)
pack([cnf]) Pack a widget in the parent widget.
pack_configure([cnf]) Pack a widget in the parent widget.
pack_forget() Unmap this widget and do not use it for the packing order.
pack_info() Return information about the packing options
pack_propagate([flag]) Set or get the status for propagation of geometry information.
pack_slaves() Return a list of all slaves of this widget
place([cnf]) Place a widget in the parent widget.
place_configure([cnf]) Place a widget in the parent widget.
place_forget() Unmap this widget.
place_info() Return information about the placing options
place_slaves() Return a list of all slaves of this widget
polygon(coords[, fill]) make a close polygon with vertices at each point in (coords)
postscript([cnf]) Print the contents of the canvas to a postscript file.
propagate([flag]) Set or get the status for propagation of geometry information.
quit() Quit the Tcl interpreter. All widgets will be destroyed.
rectangle(coords[, fill]) make an oval with bounding box (coords) and fill color (fill)
register(func[, subst, needcleanup]) Return a newly created Tcl function. If this
rowconfigure(index[, cnf]) Configure row INDEX of a grid.
scale(*args) Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.
scan_dragto(x, y[, gain]) Adjust the view of the canvas to GAIN times the
scan_mark(x, y) Remember the current X, Y coordinates.
select_adjust(tagOrId, index) Adjust the end of the selection near the cursor of an item TAGORID to index.
select_clear() Clear the selection if it is in this widget.
select_from(tagOrId, index) Set the fixed end of a selection in item TAGORID to INDEX.
select_item() Return the item which has the selection.
select_to(tagOrId, index) Set the variable end of a selection in item TAGORID to INDEX.
selection_clear(**kw) Clear the current X selection.
selection_get(**kw) Return the contents of the current X selection.
selection_handle(command, **kw) Specify a function COMMAND to call if the X
selection_own(**kw) Become owner of X selection.
selection_own_get(**kw) Return owner of X selection.
send(interp, cmd, *args) Send Tcl command CMD to different interpreter INTERP to be executed.
setvar([name, value]) Set Tcl variable NAME to VALUE.
size() Return a tuple of the number of column and rows in the grid.
slaves() Return a list of all slaves of this widget
str(pos, text[, dx, dy]) draw the given text at the given position, with an offset
tag_bind(tagOrId[, sequence, func, add]) Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.
tag_lower(*args) Lower an item TAGORID given in ARGS
tag_raise(*args) Raise an item TAGORID given in ARGS
tag_unbind(tagOrId, sequence[, funcid]) Unbind for all items with TAGORID for event SEQUENCE the
tcoords(item[, coords]) provides get and set access to item coordinates,
text(coord[, text, fill]) make a text item with the given text and fill color.
tk_bisque() Change the color scheme to light brown as used in Tk 3.6 and before.
tk_focusFollowsMouse() The widget under mouse will get automatically focus.
tk_focusNext() Return the next widget in the focus order which follows widget which has currently the focus.
tk_focusPrev() Return previous widget in the focus order.
tk_menuBar(*args) Do not use.
tk_setPalette(*args, **kw) Set a new color scheme for all widget elements.
tk_strictMotif([boolean]) Set Tcl internal variable, whether the look and feel
tkraise(*args) Raise an item TAGORID given in ARGS
tmove(tags[, dx, dy]) move all items with the given tags, with dx and dy
trans(coords) apply each of the transforms for this canvas, in order.
type(tagOrId) Return the type of the item TAGORID.
unbind(sequence[, funcid]) Unbind for this widget for event SEQUENCE the
unbind_all(sequence) Unbind for all widgets for event SEQUENCE all functions.
unbind_class(className, sequence) Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
update() Enter event loop until all pending events have been processed by Tcl.
update_idletasks() Enter event loop until all idle callbacks have been called.
wait_variable([name]) Wait until the variable is modified.
wait_visibility([window]) Wait until the visibility of a WIDGET changes
wait_window([window]) Wait until a WIDGET is destroyed.
waitvar([name]) Wait until the variable is modified.
winfo_atom(name[, displayof]) Return integer which represents atom NAME.
winfo_atomname(id[, displayof]) Return name of atom with identifier ID.
winfo_cells() Return number of cells in the colormap for this widget.
winfo_children() Return a list of all widgets which are children of this widget.
winfo_class() Return window class name of this widget.
winfo_colormapfull() Return true if at the last color request the colormap was full.
winfo_containing(rootX, rootY[, displayof]) Return the widget which is at the root coordinates ROOTX, ROOTY.
winfo_depth() Return the number of bits per pixel.
winfo_exists() Return true if this widget exists.
winfo_fpixels(number) Return the number of pixels for the given distance NUMBER
winfo_geometry() Return geometry string for this widget in the form “widthxheight+X+Y”.
winfo_height() Return height of this widget.
winfo_id() Return identifier ID for this widget.
winfo_interps([displayof]) Return the name of all Tcl interpreters for this display.
winfo_ismapped() Return true if this widget is mapped.
winfo_manager() Return the window mananger name for this widget.
winfo_name() Return the name of this widget.
winfo_parent() Return the name of the parent of this widget.
winfo_pathname(id[, displayof]) Return the pathname of the widget given by ID.
winfo_pixels(number) Rounded integer value of winfo_fpixels.
winfo_pointerx() Return the x coordinate of the pointer on the root window.
winfo_pointerxy() Return a tuple of x and y coordinates of the pointer on the root window.
winfo_pointery() Return the y coordinate of the pointer on the root window.
winfo_reqheight() Return requested height of this widget.
winfo_reqwidth() Return requested width of this widget.
winfo_rgb(color) Return tuple of decimal values for red, green, blue for
winfo_rootx() Return x coordinate of upper left corner of this widget on the
winfo_rooty() Return y coordinate of upper left corner of this widget on the
winfo_screen() Return the screen name of this widget.
winfo_screencells() Return the number of the cells in the colormap of the screen
winfo_screendepth() Return the number of bits per pixel of the root window of the
winfo_screenheight() Return the number of pixels of the height of the screen of this widget
winfo_screenmmheight() Return the number of pixels of the height of the screen of
winfo_screenmmwidth() Return the number of pixels of the width of the screen of
winfo_screenvisual() Return one of the strings directcolor, grayscale, pseudocolor,
winfo_screenwidth() Return the number of pixels of the width of the screen of
winfo_server() Return information of the X-Server of the screen of this widget in
winfo_toplevel() Return the toplevel widget of this widget.
winfo_viewable() Return true if the widget and all its higher ancestors are mapped.
winfo_visual() Return one of the strings directcolor, grayscale, pseudocolor,
winfo_visualid() Return the X identifier for the visual for this widget.
winfo_visualsavailable([includeids]) Return a list of all visuals available for the screen of this widget.
winfo_vrootheight() Return the height of the virtual root window associated with this widget in pixels.
winfo_vrootwidth() Return the width of the virtual root window associated with this widget in pixel.
winfo_vrootx() Return the x offset of the virtual root relative to the root
winfo_vrooty() Return the y offset of the virtual root relative to the root
winfo_width() Return the width of this widget.
winfo_x() Return the x coordinate of the upper left corner of this widget
winfo_y() Return the y coordinate of the upper left corner of this widget
xview(*args) Query and change the horizontal position of the view.
xview_moveto(fraction) Adjusts the view in the window so that FRACTION of the
xview_scroll(number, what) Shift the x-view according to NUMBER which is measured in “units”
yview(*args) Query and change the vertical position of the view.
yview_moveto(fraction) Adjusts the view in the window so that FRACTION of the
yview_scroll(number, what) Shift the y-view according to NUMBER which is measured in
__contains__(key)
__getitem__(key)

Return the resource value for a KEY given as string.

__init__(w, transforms=None, **options)
__module__ = 'scitools.Lumpy'
__setitem__(key, value)
__str__()

Return the window path name of this widget.

add_transform(transform, index=None)

add the given transform at the given index in the transform list (appending is the default).

addtag(*args)

Internal function.

addtag_above(newtag, tagOrId)

Add tag NEWTAG to all items above TAGORID.

addtag_all(newtag)

Add tag NEWTAG to all items.

addtag_below(newtag, tagOrId)

Add tag NEWTAG to all items below TAGORID.

addtag_closest(newtag, x, y, halo=None, start=None)

Add tag NEWTAG to item which is closest to pixel at X, Y. If several match take the top-most. All items closer than HALO are considered overlapping (all are closests). If START is specified the next below this tag is taken.

addtag_enclosed(newtag, x1, y1, x2, y2)

Add tag NEWTAG to all items in the rectangle defined by X1,Y1,X2,Y2.

addtag_overlapping(newtag, x1, y1, x2, y2)

Add tag NEWTAG to all items which overlap the rectangle defined by X1,Y1,X2,Y2.

addtag_withtag(newtag, tagOrId)

Add tag NEWTAG to all items with TAGORID.

after(ms, func=None, *args)

Call function once after given time.

MS specifies the time in milliseconds. FUNC gives the function which shall be called. Additional parameters are given as parameters to the function call. Return identifier to cancel scheduling with after_cancel.

after_cancel(id)

Cancel scheduling of function identified with ID.

Identifier returned by after or after_idle must be given as first parameter.

after_idle(func, *args)

Call FUNC once if the Tcl main loop has no event to process.

Return an identifier to cancel the scheduling with after_cancel.

arrow(start, end, **options)[source]

draw an arrow: start and end can be a Pos object or a list of two coordinates

bbox(item)

compute the bounding box of the given item (transformed from pixel coordinates to transformed coordinates).

bell(displayof=0)

Ring a display’s bell.

bind(sequence=None, func=None, add=None)

Bind to this widget at event SEQUENCE a call to function FUNC.

SEQUENCE is a string of concatenated event patterns. An event pattern is of the form <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4, Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3, B3, Alt, Button4, B4, Double, Button5, B5 Triple, Mod1, M1. TYPE is one of Activate, Enter, Map, ButtonPress, Button, Expose, Motion, ButtonRelease FocusIn, MouseWheel, Circulate, FocusOut, Property, Colormap, Gravity Reparent, Configure, KeyPress, Key, Unmap, Deactivate, KeyRelease Visibility, Destroy, Leave and DETAIL is the button number for ButtonPress, ButtonRelease and DETAIL is the Keysym for KeyPress and KeyRelease. Examples are <Control-Button-1> for pressing Control and mouse button 1 or <Alt-A> for pressing A and the Alt key (KeyPress can be omitted). An event pattern can also be a virtual event of the form <<AString>> where AString can be arbitrary. This event can be generated by event_generate. If events are concatenated they must appear shortly after each other.

FUNC will be called if the event sequence occurs with an instance of Event as argument. If the return value of FUNC is “break” no further bound function is invoked.

An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function.

Bind will return an identifier to allow deletion of the bound function with unbind without memory leak.

If FUNC or SEQUENCE is omitted the bound function or list of bound events are returned.

bind_all(sequence=None, func=None, add=None)

Bind to all widgets at an event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.

bind_class(className, sequence=None, func=None, add=None)

Bind to widgets with bindtag CLASSNAME at event SEQUENCE a call of function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.

bindtags(tagList=None)

Set or get the list of bindtags for this widget.

With no argument return the list of all bindtags associated with this widget. With a list of strings as argument the bindtags are set to this list. The bindtags determine in which order events are processed (see bind).

box(box, padx=0.5, pady=0.3, **options)[source]

draw a rectangle with the given bounding box, expanded by padx and pady. box can be a Bbox object or a list of two coordinate pairs.

canvasx(screenx, gridspacing=None)

Return the canvas x coordinate of pixel position SCREENX rounded to nearest multiple of GRIDSPACING units.

canvasy(screeny, gridspacing=None)

Return the canvas y coordinate of pixel position SCREENY rounded to nearest multiple of GRIDSPACING units.

cget(key)

Return the resource value for a KEY given as string.

circle(x, y, r, fill='', **options)

make a circle with center at (x, y) and radius (r)

clipboard_append(string, **kw)

Append STRING to the Tk clipboard.

A widget specified at the optional displayof keyword argument specifies the target display. The clipboard can be retrieved with selection_get.

clipboard_clear(**kw)

Clear the data in the Tk clipboard.

A widget specified for the optional displayof keyword argument specifies the target display.

clipboard_get(**kw)

Retrieve data from the clipboard on window’s display.

The window keyword defaults to the root window of the Tkinter application.

The type keyword specifies the form in which the data is to be returned and should be an atom name such as STRING or FILE_NAME. Type defaults to STRING.

This command is equivalent to:

selection_get(CLIPBOARD)

colormodel(value=None)

Useless. Not implemented in Tk.

columnconfigure(index, cnf={}, **kw)

Configure column INDEX of a grid.

Valid resources are minsize (minimum size of the column), weight (how much does additional space propagate to this column) and pad (how much space to let additionally).

config(cnf=None, **kw)

Configure resources of a widget.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys.

configure(cnf=None, **kw)

Configure resources of a widget.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys.

coords(*args)

Return a list of coordinates for the item given in ARGS.

create_arc(*args, **kw)

Create arc shaped region with coordinates x1,y1,x2,y2.

create_bitmap(*args, **kw)

Create bitmap with coordinates x1,y1.

create_image(*args, **kw)

Create image item with coordinates x1,y1.

create_line(*args, **kw)

Create line with coordinates x1,y1,...,xn,yn.

create_oval(*args, **kw)

Create oval with coordinates x1,y1,x2,y2.

create_polygon(*args, **kw)

Create polygon with coordinates x1,y1,...,xn,yn.

create_rectangle(*args, **kw)

Create rectangle with coordinates x1,y1,x2,y2.

create_text(*args, **kw)

Create text with coordinates x1,y1.

create_window(*args, **kw)

Create window with coordinates x1,y1,x2,y2.

dchars(*args)

Delete characters of text items identified by tag or id in ARGS (possibly several times) from FIRST to LAST character (including).

delete(*args)

Delete items identified by all tag or ids contained in ARGS.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

dot(pos, r=0.2, **options)[source]

draw a dot at the given position with radius r

dtag(*args)

Delete tag or id given as last arguments in ARGS from items identified by first argument in ARGS.

dump(filename='canvas.eps')

create a PostScipt file with the given name and dump the contents of the canvas into it.

event_add(virtual, *sequences)

Bind a virtual event VIRTUAL (of the form <<Name>>) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs.

event_delete(virtual, *sequences)

Unbind a virtual event VIRTUAL from SEQUENCE.

event_generate(sequence, **kw)

Generate an event SEQUENCE. Additional keyword arguments specify parameter of the event (e.g. x, y, rootx, rooty).

event_info(virtual=None)

Return a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL.

find(*args)

Internal function.

find_above(tagOrId)

Return items above TAGORID.

find_all()

Return all items.

find_below(tagOrId)

Return all items below TAGORID.

find_closest(x, y, halo=None, start=None)

Return item which is closest to pixel at X, Y. If several match take the top-most. All items closer than HALO are considered overlapping (all are closests). If START is specified the next below this tag is taken.

find_enclosed(x1, y1, x2, y2)

Return all items in rectangle defined by X1,Y1,X2,Y2.

find_overlapping(x1, y1, x2, y2)

Return all items which overlap the rectangle defined by X1,Y1,X2,Y2.

find_withtag(tagOrId)

Return all items with TAGORID.

flipx(item)

warning: this works in pixel coordinates

focus(*args)

Set focus to the first item specified in ARGS.

focus_displayof()

Return the widget which has currently the focus on the display where this widget is located.

Return None if the application does not have the focus.

focus_force()

Direct input focus to this widget even if the application does not have the focus. Use with caution!

focus_get()

Return the widget which has currently the focus in the application.

Use focus_displayof to allow working with several displays. Return None if application does not have the focus.

focus_lastfor()

Return the widget which would have the focus if top level for this widget gets the focus from the window manager.

focus_set()

Direct input focus to this widget.

If the application currently does not have the focus this widget will get the focus if the application gets the focus through the window manager.

forget()

Unmap this widget and do not use it for the packing order.

getboolean(s)

Return a boolean value for Tcl boolean values true and false given as parameter.

getdouble

alias of float

getint

alias of int

gettags(*args)

Return tags associated with the first item specified in ARGS.

getvar(name='PY_VAR')

Return value of Tcl variable NAME.

grab_current()

Return widget which has currently the grab in this application or None.

grab_release()

Release grab for this widget if currently set.

grab_set()

Set grab for this widget.

A grab directs all events to this and descendant widgets in the application.

grab_set_global()

Set global grab for this widget.

A global grab directs all events to this and descendant widgets on the display. Use with caution - other applications do not get events anymore.

grab_status()

Return None, “local” or “global” if this widget has no, a local or a global grab.

grid(cnf={}, **kw)

Position a widget in the parent widget in a grid. Use as options: column=number - use cell identified with given column (starting with 0) columnspan=number - this widget will span several columns in=master - use master to contain this widget in_=master - see ‘in’ option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction row=number - use cell identified with given row (starting with 0) rowspan=number - this widget will span several rows sticky=NSEW - if cell is larger on which sides will this

widget stick to the cell boundary
grid_bbox(column=None, row=None, col2=None, row2=None)

Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid.

If COLUMN, ROW is given the bounding box applies from the cell with row and column 0 to the specified cell. If COL2 and ROW2 are given the bounding box starts at that cell.

The returned integers specify the offset of the upper left corner in the master widget and the width and height.

grid_columnconfigure(index, cnf={}, **kw)

Configure column INDEX of a grid.

Valid resources are minsize (minimum size of the column), weight (how much does additional space propagate to this column) and pad (how much space to let additionally).

grid_configure(cnf={}, **kw)

Position a widget in the parent widget in a grid. Use as options: column=number - use cell identified with given column (starting with 0) columnspan=number - this widget will span several columns in=master - use master to contain this widget in_=master - see ‘in’ option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction row=number - use cell identified with given row (starting with 0) rowspan=number - this widget will span several rows sticky=NSEW - if cell is larger on which sides will this

widget stick to the cell boundary
grid_forget()

Unmap this widget.

grid_info()

Return information about the options for positioning this widget in a grid.

grid_location(x, y)

Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.

grid_propagate(flag=['_noarg_'])

Set or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given, the current setting will be returned.

grid_remove()

Unmap this widget but remember the grid options.

grid_rowconfigure(index, cnf={}, **kw)

Configure row INDEX of a grid.

Valid resources are minsize (minimum size of the row), weight (how much does additional space propagate to this row) and pad (how much space to let additionally).

grid_size()

Return a tuple of the number of column and rows in the grid.

grid_slaves(row=None, column=None)

Return a list of all slaves of this widget in its packing order.

height
icursor(*args)

Set cursor at position POS in the item identified by TAGORID. In ARGS TAGORID must be first.

image(coord, image, **options)

make an image item with the given image at the given position. The default anchor is center.

image_names()

Return a list of all existing image names.

image_types()

Return a list of all available image types (e.g. phote bitmap).

index(*args)

Return position of cursor as integer in item specified in ARGS.

info()

Return information about the packing options for this widget.

insert(*args)

Insert TEXT in item TAGORID at position POS. ARGS must be TAGORID POS TEXT.

invert(coords)

apply the inverse of each of the transforms, in reverse order.

itemcget(tagOrId, option)

Return the resource value for an OPTION for item TAGORID.

itemconfig(tagOrId, cnf=None, **kw)

Configure resources of an item TAGORID.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments.

itemconfigure(tagOrId, cnf=None, **kw)

Configure resources of an item TAGORID.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method without arguments.

keys()

Return a list of all resource names of this widget.

lift(*args)

Raise an item TAGORID given in ARGS (optional above another item).

line(coords, fill='black', **options)

make a polyline with vertices at each point in (coords) and pen color (fill).

location(x, y)

Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.

lower(*args)

Lower an item TAGORID given in ARGS (optional below another item).

mainloop(n=0)

Call the mainloop of Tk.

measure(t, **options)[source]

find the bounding box of the list of words by drawing them, measuring them, and then deleting them

move(*args)

Move an item TAGORID given in ARGS.

nametowidget(name)

Return the Tkinter instance of a widget identified by its Tcl name NAME.

option_add(pattern, value, priority=None)

Set a VALUE (second parameter) for an option PATTERN (first parameter).

An optional third parameter gives the numeric priority (defaults to 80).

option_clear()

Clear the option database.

It will be reloaded if option_add is called.

option_get(name, className)

Return the value for an option NAME for this widget with CLASSNAME.

Values with higher priority override lower values.

option_readfile(fileName, priority=None)

Read file FILENAME into the option database.

An optional second parameter gives the numeric priority.

oval(coords, fill='', **options)

make an oval with bounding box (coords) and fill color (fill)

pack(cnf={}, **kw)

Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget anchor=NSEW (or subset) - position widget according to

given direction

before=widget - pack it before you will pack widget expand=bool - expand widget if parent size grows fill=NONE or X or Y or BOTH - fill widget if widget grows in=master - use master to contain this widget in_=master - see ‘in’ option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.

pack_configure(cnf={}, **kw)

Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget anchor=NSEW (or subset) - position widget according to

given direction

before=widget - pack it before you will pack widget expand=bool - expand widget if parent size grows fill=NONE or X or Y or BOTH - fill widget if widget grows in=master - use master to contain this widget in_=master - see ‘in’ option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.

pack_forget()

Unmap this widget and do not use it for the packing order.

pack_info()

Return information about the packing options for this widget.

pack_propagate(flag=['_noarg_'])

Set or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned.

pack_slaves()

Return a list of all slaves of this widget in its packing order.

place(cnf={}, **kw)

Place a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed in_=master - see ‘in’ option description x=amount - locate anchor of this widget at position x of master y=amount - locate anchor of this widget at position y of master relx=amount - locate anchor of this widget between 0.0 and 1.0

relative to width of master (1.0 is right edge)
rely=amount - locate anchor of this widget between 0.0 and 1.0
relative to height of master (1.0 is bottom edge)

anchor=NSEW (or subset) - position anchor according to given direction width=amount - width of this widget in pixel height=amount - height of this widget in pixel relwidth=amount - width of this widget between 0.0 and 1.0

relative to width of master (1.0 is the same width as the master)
relheight=amount - height of this widget between 0.0 and 1.0
relative to height of master (1.0 is the same height as the master)
bordermode=”inside” or “outside” - whether to take border width of
master widget into account
place_configure(cnf={}, **kw)

Place a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed in_=master - see ‘in’ option description x=amount - locate anchor of this widget at position x of master y=amount - locate anchor of this widget at position y of master relx=amount - locate anchor of this widget between 0.0 and 1.0

relative to width of master (1.0 is right edge)
rely=amount - locate anchor of this widget between 0.0 and 1.0
relative to height of master (1.0 is bottom edge)

anchor=NSEW (or subset) - position anchor according to given direction width=amount - width of this widget in pixel height=amount - height of this widget in pixel relwidth=amount - width of this widget between 0.0 and 1.0

relative to width of master (1.0 is the same width as the master)
relheight=amount - height of this widget between 0.0 and 1.0
relative to height of master (1.0 is the same height as the master)
bordermode=”inside” or “outside” - whether to take border width of
master widget into account
place_forget()

Unmap this widget.

place_info()

Return information about the placing options for this widget.

place_slaves()

Return a list of all slaves of this widget in its packing order.

polygon(coords, fill='', **options)

make a close polygon with vertices at each point in (coords) and fill color (fill).

postscript(cnf={}, **kw)

Print the contents of the canvas to a postscript file. Valid options: colormap, colormode, file, fontmap, height, pageanchor, pageheight, pagewidth, pagex, pagey, rotate, witdh, x, y.

propagate(flag=['_noarg_'])

Set or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned.

quit()

Quit the Tcl interpreter. All widgets will be destroyed.

rectangle(coords, fill='', **options)

make an oval with bounding box (coords) and fill color (fill)

register(func, subst=None, needcleanup=1)

Return a newly created Tcl function. If this function is called, the Python function FUNC will be executed. An optional function SUBST can be given which will be executed before FUNC.

rowconfigure(index, cnf={}, **kw)

Configure row INDEX of a grid.

Valid resources are minsize (minimum size of the row), weight (how much does additional space propagate to this row) and pad (how much space to let additionally).

scale(*args)

Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.

scan_dragto(x, y, gain=10)

Adjust the view of the canvas to GAIN times the difference between X and Y and the coordinates given in scan_mark.

scan_mark(x, y)

Remember the current X, Y coordinates.

select_adjust(tagOrId, index)

Adjust the end of the selection near the cursor of an item TAGORID to index.

select_clear()

Clear the selection if it is in this widget.

select_from(tagOrId, index)

Set the fixed end of a selection in item TAGORID to INDEX.

select_item()

Return the item which has the selection.

select_to(tagOrId, index)

Set the variable end of a selection in item TAGORID to INDEX.

selection_clear(**kw)

Clear the current X selection.

selection_get(**kw)

Return the contents of the current X selection.

A keyword parameter selection specifies the name of the selection and defaults to PRIMARY. A keyword parameter displayof specifies a widget on the display to use.

selection_handle(command, **kw)

Specify a function COMMAND to call if the X selection owned by this widget is queried by another application.

This function must return the contents of the selection. The function will be called with the arguments OFFSET and LENGTH which allows the chunking of very long selections. The following keyword parameters can be provided: selection - name of the selection (default PRIMARY), type - type of the selection (e.g. STRING, FILE_NAME).

selection_own(**kw)

Become owner of X selection.

A keyword parameter selection specifies the name of the selection (default PRIMARY).

selection_own_get(**kw)

Return owner of X selection.

The following keyword parameter can be provided: selection - name of the selection (default PRIMARY), type - type of the selection (e.g. STRING, FILE_NAME).

send(interp, cmd, *args)

Send Tcl command CMD to different interpreter INTERP to be executed.

setvar(name='PY_VAR', value='1')

Set Tcl variable NAME to VALUE.

size()

Return a tuple of the number of column and rows in the grid.

slaves()

Return a list of all slaves of this widget in its packing order.

str(pos, text, dx=0, dy=0, **options)[source]

draw the given text at the given position, with an offset specified by dx and dy

tag_bind(tagOrId, sequence=None, func=None, add=None)

Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.

An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.

tag_lower(*args)

Lower an item TAGORID given in ARGS (optional below another item).

tag_raise(*args)

Raise an item TAGORID given in ARGS (optional above another item).

tag_unbind(tagOrId, sequence, funcid=None)

Unbind for all items with TAGORID for event SEQUENCE the function identified with FUNCID.

tcoords(item, coords=None)

provides get and set access to item coordinates, with coordinate translation in both directions.

text(coord, text='', fill='black', **options)

make a text item with the given text and fill color. The default anchor is center.

tk_bisque()

Change the color scheme to light brown as used in Tk 3.6 and before.

tk_focusFollowsMouse()

The widget under mouse will get automatically focus. Can not be disabled easily.

tk_focusNext()

Return the next widget in the focus order which follows widget which has currently the focus.

The focus order first goes to the next child, then to the children of the child recursively and then to the next sibling which is higher in the stacking order. A widget is omitted if it has the takefocus resource set to 0.

tk_focusPrev()

Return previous widget in the focus order. See tk_focusNext for details.

tk_menuBar(*args)

Do not use. Needed in Tk 3.6 and earlier.

tk_setPalette(*args, **kw)

Set a new color scheme for all widget elements.

A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The following keywords are valid: activeBackground, foreground, selectColor, activeForeground, highlightBackground, selectBackground, background, highlightColor, selectForeground, disabledForeground, insertBackground, troughColor.

tk_strictMotif(boolean=None)

Set Tcl internal variable, whether the look and feel should adhere to Motif.

A parameter of 1 means adhere to Motif (e.g. no color change if mouse passes over slider). Returns the set value.

tkraise(*args)

Raise an item TAGORID given in ARGS (optional above another item).

tmove(tags, dx=0, dy=0)

move all items with the given tags, with dx and dy in untransformed coordinates

trans(coords)

apply each of the transforms for this canvas, in order.

type(tagOrId)

Return the type of the item TAGORID.

unbind(sequence, funcid=None)

Unbind for this widget for event SEQUENCE the function identified with FUNCID.

unbind_all(sequence)

Unbind for all widgets for event SEQUENCE all functions.

unbind_class(className, sequence)

Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE all functions.

update()

Enter event loop until all pending events have been processed by Tcl.

update_idletasks()

Enter event loop until all idle callbacks have been called. This will update the display of windows but not process events caused by the user.

wait_variable(name='PY_VAR')

Wait until the variable is modified.

A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.

wait_visibility(window=None)

Wait until the visibility of a WIDGET changes (e.g. it appears).

If no parameter is given self is used.

wait_window(window=None)

Wait until a WIDGET is destroyed.

If no parameter is given self is used.

waitvar(name='PY_VAR')

Wait until the variable is modified.

A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.

width
winfo_atom(name, displayof=0)

Return integer which represents atom NAME.

winfo_atomname(id, displayof=0)

Return name of atom with identifier ID.

winfo_cells()

Return number of cells in the colormap for this widget.

winfo_children()

Return a list of all widgets which are children of this widget.

winfo_class()

Return window class name of this widget.

winfo_colormapfull()

Return true if at the last color request the colormap was full.

winfo_containing(rootX, rootY, displayof=0)

Return the widget which is at the root coordinates ROOTX, ROOTY.

winfo_depth()

Return the number of bits per pixel.

winfo_exists()

Return true if this widget exists.

winfo_fpixels(number)

Return the number of pixels for the given distance NUMBER (e.g. “3c”) as float.

winfo_geometry()

Return geometry string for this widget in the form “widthxheight+X+Y”.

winfo_height()

Return height of this widget.

winfo_id()

Return identifier ID for this widget.

winfo_interps(displayof=0)

Return the name of all Tcl interpreters for this display.

winfo_ismapped()

Return true if this widget is mapped.

winfo_manager()

Return the window mananger name for this widget.

winfo_name()

Return the name of this widget.

winfo_parent()

Return the name of the parent of this widget.

winfo_pathname(id, displayof=0)

Return the pathname of the widget given by ID.

winfo_pixels(number)

Rounded integer value of winfo_fpixels.

winfo_pointerx()

Return the x coordinate of the pointer on the root window.

winfo_pointerxy()

Return a tuple of x and y coordinates of the pointer on the root window.

winfo_pointery()

Return the y coordinate of the pointer on the root window.

winfo_reqheight()

Return requested height of this widget.

winfo_reqwidth()

Return requested width of this widget.

winfo_rgb(color)

Return tuple of decimal values for red, green, blue for COLOR in this widget.

winfo_rootx()

Return x coordinate of upper left corner of this widget on the root window.

winfo_rooty()

Return y coordinate of upper left corner of this widget on the root window.

winfo_screen()

Return the screen name of this widget.

winfo_screencells()

Return the number of the cells in the colormap of the screen of this widget.

winfo_screendepth()

Return the number of bits per pixel of the root window of the screen of this widget.

winfo_screenheight()

Return the number of pixels of the height of the screen of this widget in pixel.

winfo_screenmmheight()

Return the number of pixels of the height of the screen of this widget in mm.

winfo_screenmmwidth()

Return the number of pixels of the width of the screen of this widget in mm.

winfo_screenvisual()

Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen.

winfo_screenwidth()

Return the number of pixels of the width of the screen of this widget in pixel.

winfo_server()

Return information of the X-Server of the screen of this widget in the form “XmajorRminor vendor vendorVersion”.

winfo_toplevel()

Return the toplevel widget of this widget.

winfo_viewable()

Return true if the widget and all its higher ancestors are mapped.

winfo_visual()

Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.

winfo_visualid()

Return the X identifier for the visual for this widget.

winfo_visualsavailable(includeids=0)

Return a list of all visuals available for the screen of this widget.

Each item in the list consists of a visual name (see winfo_visual), a depth and if INCLUDEIDS=1 is given also the X identifier.

winfo_vrootheight()

Return the height of the virtual root window associated with this widget in pixels. If there is no virtual root window return the height of the screen.

winfo_vrootwidth()

Return the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.

winfo_vrootx()

Return the x offset of the virtual root relative to the root window of the screen of this widget.

winfo_vrooty()

Return the y offset of the virtual root relative to the root window of the screen of this widget.

winfo_width()

Return the width of this widget.

winfo_x()

Return the x coordinate of the upper left corner of this widget in the parent.

winfo_y()

Return the y coordinate of the upper left corner of this widget in the parent.

xview(*args)

Query and change the horizontal position of the view.

xview_moveto(fraction)

Adjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.

xview_scroll(number, what)

Shift the x-view according to NUMBER which is measured in “units” or “pages” (WHAT).

yview(*args)

Query and change the vertical position of the view.

yview_moveto(fraction)

Adjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.

yview_scroll(number, what)

Shift the y-view according to NUMBER which is measured in “units” or “pages” (WHAT).

class scitools.Lumpy.Diagram(lumpy)[source]

Bases: object

the parent class for ClassDiagram and ObjectDiagram.

Methods

add_arrow(arrow) append a new arrow on the list
ca(*args, **options) make a canvas for the diagram
close() close the window and exit
draw_arrows() draw all the arrows on the list
printfile() dump the contents of the canvas to the filename in the
setup() create the gui for the diagram
update_arrows([n]) update up to n arrows (or all of them is n==None)
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', 'setup': <function setup at 0x50e8aa0>, 'draw_arrows': <function draw_arrows at 0x50e8c80>, 'printfile': <function printfile at 0x50e8b18>, '__init__': <function __init__ at 0x50e89b0>, 'close': <function close at 0x50e8b90>, '__dict__': <attribute '__dict__' of 'Diagram' objects>, 'update_arrows': <function update_arrows at 0x50e8cf8>, 'ca': <function ca at 0x50e8a28>, '__weakref__': <attribute '__weakref__' of 'Diagram' objects>, '__doc__': 'the parent class for ClassDiagram and ObjectDiagram.\n ', 'add_arrow': <function add_arrow at 0x50e8c08>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy)[source]
__module__ = 'scitools.Lumpy'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

add_arrow(arrow)[source]

append a new arrow on the list

ca(*args, **options)[source]

make a canvas for the diagram

close()[source]

close the window and exit

draw_arrows()[source]

draw all the arrows on the list

printfile()[source]

dump the contents of the canvas to the filename in the filename entry.

setup()[source]

create the gui for the diagram

update_arrows(n=None)[source]

update up to n arrows (or all of them is n==None)

class scitools.Lumpy.Dot[source]

Bases: scitools.Lumpy.Thing

the Thing that represents a dot in a diagram

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags])
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', '__doc__': 'the Thing that represents a dot in a diagram', 'drawme': <function drawme at 0x50ec848>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__

x.__init__(...) initializes x; see help(type(x)) for signature

__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Frame(lumpy, frame)[source]

Bases: scitools.Lumpy.Mapping

The graphical representation of a frame, implemented as a list of Bindings

Methods

bbox() the bbox of a Mapping is the bbox of its box item.
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags]) drawme is the middle part of the way objects are drawn.
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
scan_bindings(cls) scan the bindings in this mapping, looking for
scan_val(cls, val) if we find a reference to an object type, make a note
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', '__doc__': 'The graphical representation of a frame,\n implemented as a list of Bindings', '__init__': <function __init__ at 0x50ecf50>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, frame)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

the bbox of a Mapping is the bbox of its box item. This is different from other Things.

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())

drawme is the middle part of the way objects are drawn. Thing.draw does some prep work, invokes drawme, and then does some cleanup. draw and drawme are not allowed to modify pos.

isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

scan_bindings(cls)

scan the bindings in this mapping, looking for references to other object types. cls is the Class of the object that contains this mapping

scan_val(cls, val)

if we find a reference to an object type, make a note of the HAS-A relationship. If we find a reference to a container type, scan it for references.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Index(lumpy, val)[source]

Bases: scitools.Lumpy.Simple

the graphical representation of an index in a Sequence. An Index object does not register with lumpy, so that even in pedantic mode, it is always drawn, and it is never the target of a reference (since it is not really a value at run-time).

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags])
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__init__': <function __init__ at 0x50ec9b0>, '__module__': 'scitools.Lumpy', '__doc__': 'the graphical representation of an index in a Sequence.\n An Index object does not register with lumpy, so that even\n in pedantic mode, it is always drawn, and it is never the\n target of a reference (since it is not really a value at\n run-time).\n ', 'drawme': <function drawme at 0x50eca28>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, val)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Instance(lumpy, val)[source]

Bases: scitools.Lumpy.Mapping

The graphical representation of an object (usually). Anything with a __dict__ is treated as an Instance.

Methods

bbox() the bbox of a Mapping is the bbox of its box item.
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags]) drawme is the middle part of the way objects are drawn.
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
scan_bindings(cls) scan the bindings in this Instance, looking for
scan_val(cls, val) if we find a reference to an object type, make a note
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'scan_bindings': <function scan_bindings at 0x50ece60>, '__module__': 'scitools.Lumpy', '__doc__': 'The graphical representation of an object (usually).\n Anything with a __dict__ is treated as an Instance.\n ', '__init__': <function __init__ at 0x50ecde8>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, val)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

the bbox of a Mapping is the bbox of its box item. This is different from other Things.

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())

drawme is the middle part of the way objects are drawn. Thing.draw does some prep work, invokes drawme, and then does some cleanup. draw and drawme are not allowed to modify pos.

isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

scan_bindings(cls)[source]

scan the bindings in this Instance, looking for references to other object types; also, make a note of the names of the instance variables. cls is the Class object this instance belongs to.

scan_val(cls, val)

if we find a reference to an object type, make a note of the HAS-A relationship. If we find a reference to a container type, scan it for references.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Lumpy(debug=False, pedantic=False)[source]

Bases: scitools._Gui.Gui

the Lumpy object represents the GUI window.

Methods

ScrollableCanvas
ScrollableText
after(ms[, func]) Call function once after given time.
after_cancel(id) Cancel scheduling of function identified with ID.
after_idle(func, *args) Call FUNC once if the Tcl main loop has no event to
aspect([minNumer, minDenom, maxNumer, maxDenom]) Instruct the window manager to set the aspect ratio (width/height)
attributes(*args) This subcommand returns or sets platform specific attributes
bbox([column, row, col2, row2]) Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid.
bell([displayof]) Ring a display’s bell.
bind([sequence, func, add]) Bind to this widget at event SEQUENCE a call to function FUNC.
bind_all([sequence, func, add]) Bind to all widgets at an event SEQUENCE a call to function FUNC.
bind_class(className[, sequence, func, add]) Bind to widgets with bindtag CLASSNAME at event
bindtags([tagList]) Set or get the list of bindtags for this widget.
bu(*args, **options) make a button
ca(*args, **options) make a canvas widget.
cb(*args, **options) make a checkbutton.
cget(key) Return the resource value for a KEY given as string.
class_diagram([classes]) create a new object diagram based on the current state.
client([name]) Store NAME in WM_CLIENT_MACHINE property of this widget. Return
clipboard_append(string, **kw) Append STRING to the Tk clipboard.
clipboard_clear(**kw) Clear the data in the Tk clipboard.
clipboard_get(**kw) Retrieve data from the clipboard on window’s display.
colormapwindows(*wlist) Store list of window names (WLIST) into WM_COLORMAPWINDOWS property
colormodel([value]) Useless.
columnconfigure(index[, cnf]) Configure column INDEX of a grid.
colweights(weights) attach weights to the columns of the current grid.
command([value]) Store VALUE in WM_COMMAND property. It is the command
config([cnf]) Configure resources of a widget.
configure([cnf]) Configure resources of a widget.
deiconify() Deiconify this widget.
deletecommand(name) Internal function.
destroy() Destroy this and all descendants widgets.
en(*args, **options) make an entry widget.
endfr() end the current frame (and return it)
endgr() end the current frame (and return it)
event_add(virtual, *sequences) Bind a virtual event VIRTUAL (of the form <<Name>>)
event_delete(virtual, *sequences) Unbind a virtual event VIRTUAL from SEQUENCE.
event_generate(sequence, **kw) Generate an event SEQUENCE. Additional
event_info([virtual]) Return a list of all virtual events or the information
focus() Direct input focus to this widget.
focus_displayof() Return the widget which has currently the focus on the display where this widget is located.
focus_force() Direct input focus to this widget even if the application does not have the focus.
focus_get() Return the widget which has currently the focus in the application.
focus_lastfor() Return the widget which would have the focus if top level
focus_set() Direct input focus to this widget.
focusmodel([model]) Set focus model to MODEL. “active” means that this widget will claim
fr(*args, **options) make a return a frame.
geometry([newGeometry]) Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
get_class_list() return the list of classes that should be drawn in
getboolean(s) Return a boolean value for Tcl boolean values true and false given as parameter.
getdouble
getint
getvar([name]) Return value of Tcl variable NAME.
gr(cols[, cweights, rweights]) create a frame and switch to grid mode.
grab_current() Return widget which has currently the grab in this application
grab_release() Release grab for this widget if currently set.
grab_set() Set grab for this widget.
grab_set_global() Set global grab for this widget.
grab_status() Return None, “local” or “global” if this widget has
grid(widget[, i, j]) pack the given widget in the current grid.
grid_bbox([column, row, col2, row2]) Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid.
grid_columnconfigure(index[, cnf]) Configure column INDEX of a grid.
grid_location(x, y) Return a tuple of column and row which identify the cell
grid_propagate([flag]) Set or get the status for propagation of geometry information.
grid_rowconfigure(index[, cnf]) Configure row INDEX of a grid.
grid_size() Return a tuple of the number of column and rows in the grid.
grid_slaves([row, column]) Return a list of all slaves of this widget
group([pathName]) Set the group leader widgets for related widgets to PATHNAME. Return
iconbitmap([bitmap, default]) Set bitmap for the iconified widget to BITMAP. Return
iconify() Display widget as icon.
iconmask([bitmap]) Set mask for the icon bitmap of this widget.
iconname([newName]) Set the name of the icon for this widget.
iconposition([x, y]) Set the position of the icon of this widget to X and Y. Return
iconwindow([pathName]) Set widget PATHNAME to be displayed instead of icon. Return the current
image_names() Return a list of all existing image names.
image_types() Return a list of all available image types (e.g.
is_opaque(classobj) check whether this class is completely opaque
keys() Return a list of all resource names of this widget.
la(*args, **options) make a label widget.
lb(*args, **options) make a listbox.
lift([aboveThis]) Raise this widget in the stacking order.
loadtk()
lookup(val) check to see whether the given value is already represented
lower([belowThis]) Lower this widget in the stacking order.
mainloop([n]) Call the mainloop of Tk.
make_reference() make a reference point by taking a snapshot of the current
make_reference2() this extra method call is here so that the reference
make_stack() take a snapshot of the current state, subtract away the
maxsize([width, height]) Set max WIDTH and HEIGHT for this widget. If the window is gridded
mb(*args, **options) make a menubutton
mi(mb[, label]) make a menu item
minsize([width, height]) Set min WIDTH and HEIGHT for this widget. If the window is gridded
nametowidget(name) Return the Tkinter instance of a widget identified by
object_diagram([obj]) create a new object diagram based on the current state.
opaque_class(classobj) restrict this class to no variables
opaque_module(modobj) make all classes defined in this module opaque
option_add(pattern, value[, priority]) Set a VALUE (second parameter) for an option
option_clear() Clear the option database.
option_get(name, className) Return the value for an option NAME for this widget
option_readfile(fileName[, priority]) Read file FILENAME into the option database.
overrideredirect([boolean]) Instruct the window manager to ignore this widget
pack_propagate([flag]) Set or get the status for propagation of geometry information.
pack_slaves() Return a list of all slaves of this widget
place_slaves() Return a list of all slaves of this widget
popfr() end the current frame (and return it)
positionfrom([who]) Instruct the window manager that the position of this widget shall
propagate([flag]) Set or get the status for propagation of geometry information.
protocol([name, func]) Bind function FUNC to command NAME for this widget.
pushfr(frame) push a frame onto the frame stack
quit() Quit the Tcl interpreter. All widgets will be destroyed.
rb(*args, **options) make a radiobutton
readprofile(baseName, className) Internal function.
register(thing, val) associate a value with the Thing that represents it,
report_callback_exception(exc, val, tb) Internal function.
resizable([width, height]) Instruct the window manager whether this width can be resized
restrict_class(classobj[, vars]) restrict this class so that when it is drawn, only
rowconfigure(index[, cnf]) Configure row INDEX of a grid.
rowweights(weights) attach weights to the rows of the current grid.
sb(*args, **options) make a text scrollbar
sc(*args, **options) make a scrollable canvas.
selection_clear(**kw) Clear the current X selection.
selection_get(**kw) Return the contents of the current X selection.
selection_handle(command, **kw) Specify a function COMMAND to call if the X
selection_own(**kw) Become owner of X selection.
selection_own_get(**kw) Return owner of X selection.
send(interp, cmd, *args) Send Tcl command CMD to different interpreter INTERP to be executed.
setvar([name, value]) Set Tcl variable NAME to VALUE.
size() Return a tuple of the number of column and rows in the grid.
sizefrom([who]) Instruct the window manager that the size of this widget shall
slaves() Return a list of all slaves of this widget
st(*args, **options) make a scrollable text entry
state([newstate]) Query or set the state of this widget as one of normal, icon,
te(*args, **options) make a text entry
title([string]) Set the title of this widget.
tk_bisque() Change the color scheme to light brown as used in Tk 3.6 and before.
tk_focusFollowsMouse() The widget under mouse will get automatically focus.
tk_focusNext() Return the next widget in the focus order which follows widget which has currently the focus.
tk_focusPrev() Return previous widget in the focus order.
tk_menuBar(*args) Do not use.
tk_setPalette(*args, **kw) Set a new color scheme for all widget elements.
tk_strictMotif([boolean]) Set Tcl internal variable, whether the look and feel
tkraise([aboveThis]) Raise this widget in the stacking order.
tl(**options) make a return a top level window.
transient([master]) Instruct the window manager that this widget is transient
transparent_class(classobj) remove the given type or class from the dictionary, which
unbind(sequence[, funcid]) Unbind for this widget for event SEQUENCE the
unbind_all(sequence) Unbind for all widgets for event SEQUENCE all functions.
unbind_class(className, sequence) Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE
update() Enter event loop until all pending events have been processed by Tcl.
update_idletasks() Enter event loop until all idle callbacks have been called.
wait_variable([name]) Wait until the variable is modified.
wait_visibility([window]) Wait until the visibility of a WIDGET changes
wait_window([window]) Wait until a WIDGET is destroyed.
waitvar([name]) Wait until the variable is modified.
widget(constructor, *args, **options) this is the kernel of the widget constructors.
winfo_atom(name[, displayof]) Return integer which represents atom NAME.
winfo_atomname(id[, displayof]) Return name of atom with identifier ID.
winfo_cells() Return number of cells in the colormap for this widget.
winfo_children() Return a list of all widgets which are children of this widget.
winfo_class() Return window class name of this widget.
winfo_colormapfull() Return true if at the last color request the colormap was full.
winfo_containing(rootX, rootY[, displayof]) Return the widget which is at the root coordinates ROOTX, ROOTY.
winfo_depth() Return the number of bits per pixel.
winfo_exists() Return true if this widget exists.
winfo_fpixels(number) Return the number of pixels for the given distance NUMBER
winfo_geometry() Return geometry string for this widget in the form “widthxheight+X+Y”.
winfo_height() Return height of this widget.
winfo_id() Return identifier ID for this widget.
winfo_interps([displayof]) Return the name of all Tcl interpreters for this display.
winfo_ismapped() Return true if this widget is mapped.
winfo_manager() Return the window mananger name for this widget.
winfo_name() Return the name of this widget.
winfo_parent() Return the name of the parent of this widget.
winfo_pathname(id[, displayof]) Return the pathname of the widget given by ID.
winfo_pixels(number) Rounded integer value of winfo_fpixels.
winfo_pointerx() Return the x coordinate of the pointer on the root window.
winfo_pointerxy() Return a tuple of x and y coordinates of the pointer on the root window.
winfo_pointery() Return the y coordinate of the pointer on the root window.
winfo_reqheight() Return requested height of this widget.
winfo_reqwidth() Return requested width of this widget.
winfo_rgb(color) Return tuple of decimal values for red, green, blue for
winfo_rootx() Return x coordinate of upper left corner of this widget on the
winfo_rooty() Return y coordinate of upper left corner of this widget on the
winfo_screen() Return the screen name of this widget.
winfo_screencells() Return the number of the cells in the colormap of the screen
winfo_screendepth() Return the number of bits per pixel of the root window of the
winfo_screenheight() Return the number of pixels of the height of the screen of this widget
winfo_screenmmheight() Return the number of pixels of the height of the screen of
winfo_screenmmwidth() Return the number of pixels of the width of the screen of
winfo_screenvisual() Return one of the strings directcolor, grayscale, pseudocolor,
winfo_screenwidth() Return the number of pixels of the width of the screen of
winfo_server() Return information of the X-Server of the screen of this widget in
winfo_toplevel() Return the toplevel widget of this widget.
winfo_viewable() Return true if the widget and all its higher ancestors are mapped.
winfo_visual() Return one of the strings directcolor, grayscale, pseudocolor,
winfo_visualid() Return the X identifier for the visual for this widget.
winfo_visualsavailable([includeids]) Return a list of all visuals available for the screen of this widget.
winfo_vrootheight() Return the height of the virtual root window associated with this widget in pixels.
winfo_vrootwidth() Return the width of the virtual root window associated with this widget in pixel.
winfo_vrootx() Return the x offset of the virtual root relative to the root
winfo_vrooty() Return the y offset of the virtual root relative to the root
winfo_width() Return the width of this widget.
winfo_x() Return the x coordinate of the upper left corner of this widget
winfo_y() Return the y coordinate of the upper left corner of this widget
withdraw() Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager.
wm_aspect([minNumer, minDenom, maxNumer, ...]) Instruct the window manager to set the aspect ratio (width/height)
wm_attributes(*args) This subcommand returns or sets platform specific attributes
wm_client([name]) Store NAME in WM_CLIENT_MACHINE property of this widget. Return
wm_colormapwindows(*wlist) Store list of window names (WLIST) into WM_COLORMAPWINDOWS property
wm_command([value]) Store VALUE in WM_COMMAND property. It is the command
wm_deiconify() Deiconify this widget.
wm_focusmodel([model]) Set focus model to MODEL. “active” means that this widget will claim
wm_frame() Return identifier for decorative frame of this widget if present.
wm_geometry([newGeometry]) Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
wm_grid([baseWidth, baseHeight, widthInc, ...]) Instruct the window manager that this widget shall only be resized on grid boundaries.
wm_group([pathName]) Set the group leader widgets for related widgets to PATHNAME. Return
wm_iconbitmap([bitmap, default]) Set bitmap for the iconified widget to BITMAP. Return
wm_iconify() Display widget as icon.
wm_iconmask([bitmap]) Set mask for the icon bitmap of this widget.
wm_iconname([newName]) Set the name of the icon for this widget.
wm_iconposition([x, y]) Set the position of the icon of this widget to X and Y. Return
wm_iconwindow([pathName]) Set widget PATHNAME to be displayed instead of icon. Return the current
wm_maxsize([width, height]) Set max WIDTH and HEIGHT for this widget. If the window is gridded
wm_minsize([width, height]) Set min WIDTH and HEIGHT for this widget. If the window is gridded
wm_overrideredirect([boolean]) Instruct the window manager to ignore this widget
wm_positionfrom([who]) Instruct the window manager that the position of this widget shall
wm_protocol([name, func]) Bind function FUNC to command NAME for this widget.
wm_resizable([width, height]) Instruct the window manager whether this width can be resized
wm_sizefrom([who]) Instruct the window manager that the size of this widget shall
wm_state([newstate]) Query or set the state of this widget as one of normal, icon,
wm_title([string]) Set the title of this widget.
wm_transient([master]) Instruct the window manager that this widget is transient
wm_withdraw() Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager.
class ScrollableCanvas(gui, width=200, height=200, **options)

a compound widget with a grid that contains a canvas and two scrollbars

__init__(gui, width=200, height=200, **options)
__module__ = 'scitools._Gui'
class Lumpy.ScrollableText(gui, *args, **options)

a scrollable text entry is a compound widget with a frame that contains a text entry on the left and a scrollbar on the right.

__init__(gui, *args, **options)
__module__ = 'scitools._Gui'
Lumpy.__contains__(key)
Lumpy.__getattr__(attr)

Delegate attribute access to the interpreter object

Lumpy.__getitem__(key)

Return the resource value for a KEY given as string.

Lumpy.__init__(debug=False, pedantic=False)[source]

debug is passed to Gui.__init__; it makes the outlines of the frames visible. If pedantic is false, simple values are replicated, rather than, for example, having all references to 1 refer to the same int object.

Lumpy.__module__ = 'scitools.Lumpy'
Lumpy.__setitem__(key, value)
Lumpy.__str__()

Return the window path name of this widget.

Lumpy.after(ms, func=None, *args)

Call function once after given time.

MS specifies the time in milliseconds. FUNC gives the function which shall be called. Additional parameters are given as parameters to the function call. Return identifier to cancel scheduling with after_cancel.

Lumpy.after_cancel(id)

Cancel scheduling of function identified with ID.

Identifier returned by after or after_idle must be given as first parameter.

Lumpy.after_idle(func, *args)

Call FUNC once if the Tcl main loop has no event to process.

Return an identifier to cancel the scheduling with after_cancel.

Lumpy.argnames = ['side', 'fill', 'expand', 'anchor']
Lumpy.aspect(minNumer=None, minDenom=None, maxNumer=None, maxDenom=None)

Instruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple of the actual values if no argument is given.

Lumpy.attributes(*args)

This subcommand returns or sets platform specific attributes

The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows:

On Windows, -disabled gets or sets whether the window is in a disabled state. -toolwindow gets or sets the style of the window to toolwindow (as defined in the MSDN). -topmost gets or sets whether this is a topmost window (displays above all other windows).

On Macintosh, XXXXX

On Unix, there are currently no special attribute values.

Lumpy.bbox(column=None, row=None, col2=None, row2=None)

Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid.

If COLUMN, ROW is given the bounding box applies from the cell with row and column 0 to the specified cell. If COL2 and ROW2 are given the bounding box starts at that cell.

The returned integers specify the offset of the upper left corner in the master widget and the width and height.

Lumpy.bell(displayof=0)

Ring a display’s bell.

Lumpy.bind(sequence=None, func=None, add=None)

Bind to this widget at event SEQUENCE a call to function FUNC.

SEQUENCE is a string of concatenated event patterns. An event pattern is of the form <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4, Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3, B3, Alt, Button4, B4, Double, Button5, B5 Triple, Mod1, M1. TYPE is one of Activate, Enter, Map, ButtonPress, Button, Expose, Motion, ButtonRelease FocusIn, MouseWheel, Circulate, FocusOut, Property, Colormap, Gravity Reparent, Configure, KeyPress, Key, Unmap, Deactivate, KeyRelease Visibility, Destroy, Leave and DETAIL is the button number for ButtonPress, ButtonRelease and DETAIL is the Keysym for KeyPress and KeyRelease. Examples are <Control-Button-1> for pressing Control and mouse button 1 or <Alt-A> for pressing A and the Alt key (KeyPress can be omitted). An event pattern can also be a virtual event of the form <<AString>> where AString can be arbitrary. This event can be generated by event_generate. If events are concatenated they must appear shortly after each other.

FUNC will be called if the event sequence occurs with an instance of Event as argument. If the return value of FUNC is “break” no further bound function is invoked.

An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function.

Bind will return an identifier to allow deletion of the bound function with unbind without memory leak.

If FUNC or SEQUENCE is omitted the bound function or list of bound events are returned.

Lumpy.bind_all(sequence=None, func=None, add=None)

Bind to all widgets at an event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.

Lumpy.bind_class(className, sequence=None, func=None, add=None)

Bind to widgets with bindtag CLASSNAME at event SEQUENCE a call of function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.

Lumpy.bindtags(tagList=None)

Set or get the list of bindtags for this widget.

With no argument return the list of all bindtags associated with this widget. With a list of strings as argument the bindtags are set to this list. The bindtags determine in which order events are processed (see bind).

Lumpy.bu(*args, **options)

make a button

Lumpy.ca(*args, **options)

make a canvas widget.

Lumpy.cb(*args, **options)

make a checkbutton.

Lumpy.cget(key)

Return the resource value for a KEY given as string.

Lumpy.class_diagram(classes=None)[source]

create a new object diagram based on the current state. If a list of classes is provided, only those classes are shown. Otherwise, all classes that Lumpy know about are shown.

Lumpy.client(name=None)

Store NAME in WM_CLIENT_MACHINE property of this widget. Return current value.

Lumpy.clipboard_append(string, **kw)

Append STRING to the Tk clipboard.

A widget specified at the optional displayof keyword argument specifies the target display. The clipboard can be retrieved with selection_get.

Lumpy.clipboard_clear(**kw)

Clear the data in the Tk clipboard.

A widget specified for the optional displayof keyword argument specifies the target display.

Lumpy.clipboard_get(**kw)

Retrieve data from the clipboard on window’s display.

The window keyword defaults to the root window of the Tkinter application.

The type keyword specifies the form in which the data is to be returned and should be an atom name such as STRING or FILE_NAME. Type defaults to STRING.

This command is equivalent to:

selection_get(CLIPBOARD)

Lumpy.colormapwindows(*wlist)

Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.

Lumpy.colormodel(value=None)

Useless. Not implemented in Tk.

Lumpy.columnconfigure(index, cnf={}, **kw)

Configure column INDEX of a grid.

Valid resources are minsize (minimum size of the column), weight (how much does additional space propagate to this column) and pad (how much space to let additionally).

Lumpy.colweights(weights)

attach weights to the columns of the current grid. These weights control how the columns in the grid expand when the grid expands. The default weight is 0, which means that the column doesn’t expand. If only one column has a value, it gets all the extra space.

Lumpy.command(value=None)

Store VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.

Lumpy.config(cnf=None, **kw)

Configure resources of a widget.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys.

Lumpy.configure(cnf=None, **kw)

Configure resources of a widget.

The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys.

Lumpy.deiconify()

Deiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.

Lumpy.deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

Lumpy.destroy()

Destroy this and all descendants widgets. This will end the application of this Tcl interpreter.

Lumpy.en(*args, **options)

make an entry widget.

Lumpy.endfr()

end the current frame (and return it)

Lumpy.endgr()

end the current frame (and return it)

Lumpy.event_add(virtual, *sequences)

Bind a virtual event VIRTUAL (of the form <<Name>>) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs.

Lumpy.event_delete(virtual, *sequences)

Unbind a virtual event VIRTUAL from SEQUENCE.

Lumpy.event_generate(sequence, **kw)

Generate an event SEQUENCE. Additional keyword arguments specify parameter of the event (e.g. x, y, rootx, rooty).

Lumpy.event_info(virtual=None)

Return a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL.

Lumpy.focus()

Direct input focus to this widget.

If the application currently does not have the focus this widget will get the focus if the application gets the focus through the window manager.

Lumpy.focus_displayof()

Return the widget which has currently the focus on the display where this widget is located.

Return None if the application does not have the focus.

Lumpy.focus_force()

Direct input focus to this widget even if the application does not have the focus. Use with caution!

Lumpy.focus_get()

Return the widget which has currently the focus in the application.

Use focus_displayof to allow working with several displays. Return None if application does not have the focus.

Lumpy.focus_lastfor()

Return the widget which would have the focus if top level for this widget gets the focus from the window manager.

Lumpy.focus_set()

Direct input focus to this widget.

If the application currently does not have the focus this widget will get the focus if the application gets the focus through the window manager.

Lumpy.focusmodel(model=None)

Set focus model to MODEL. “active” means that this widget will claim the focus itself, “passive” means that the window manager shall give the focus. Return current focus model if MODEL is None.

Lumpy.fr(*args, **options)

make a return a frame. As a side effect, the new frame becomes the current frame

Lumpy.frame
Lumpy.geometry(newGeometry=None)

Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.

Lumpy.get_class_list()[source]

return the list of classes that should be drawn in a class diagram

Lumpy.getboolean(s)

Return a boolean value for Tcl boolean values true and false given as parameter.

Lumpy.getdouble

alias of float

Lumpy.getint

alias of int

Lumpy.getvar(name='PY_VAR')

Return value of Tcl variable NAME.

Lumpy.gr(cols, cweights=[1], rweights=[1], **options)

create a frame and switch to grid mode. cols is the number of columns in the grid (no need to specify the number of rows). cweight and rweight control how the widgets expand if the frame expands (see colweights and rowweights below). options are passed along to the frame

Lumpy.grab_current()

Return widget which has currently the grab in this application or None.

Lumpy.grab_release()

Release grab for this widget if currently set.

Lumpy.grab_set()

Set grab for this widget.

A grab directs all events to this and descendant widgets in the application.

Lumpy.grab_set_global()

Set global grab for this widget.

A global grab directs all events to this and descendant widgets on the display. Use with caution - other applications do not get events anymore.

Lumpy.grab_status()

Return None, “local” or “global” if this widget has no, a local or a global grab.

Lumpy.grid(widget, i=None, j=None, **options)

pack the given widget in the current grid. By default, the widget is packed in the next available space, but parameters i and j can override.

Lumpy.grid_bbox(column=None, row=None, col2=None, row2=None)

Return a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid.

If COLUMN, ROW is given the bounding box applies from the cell with row and column 0 to the specified cell. If COL2 and ROW2 are given the bounding box starts at that cell.

The returned integers specify the offset of the upper left corner in the master widget and the width and height.

Lumpy.grid_columnconfigure(index, cnf={}, **kw)

Configure column INDEX of a grid.

Valid resources are minsize (minimum size of the column), weight (how much does additional space propagate to this column) and pad (how much space to let additionally).

Lumpy.grid_location(x, y)

Return a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.

Lumpy.grid_propagate(flag=['_noarg_'])

Set or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given, the current setting will be returned.

Lumpy.grid_rowconfigure(index, cnf={}, **kw)

Configure row INDEX of a grid.

Valid resources are minsize (minimum size of the row), weight (how much does additional space propagate to this row) and pad (how much space to let additionally).

Lumpy.grid_size()

Return a tuple of the number of column and rows in the grid.

Lumpy.grid_slaves(row=None, column=None)

Return a list of all slaves of this widget in its packing order.

Lumpy.group(pathName=None)

Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.

Lumpy.iconbitmap(bitmap=None, default=None)

Set bitmap for the iconified widget to BITMAP. Return the bitmap if None is given.

Under Windows, the DEFAULT parameter can be used to set the icon for the widget and any descendents that don’t have an icon set explicitly. DEFAULT can be the relative path to a .ico file (example: root.iconbitmap(default=’myicon.ico’) ). See Tk documentation for more information.

Lumpy.iconify()

Display widget as icon.

Lumpy.iconmask(bitmap=None)

Set mask for the icon bitmap of this widget. Return the mask if None is given.

Lumpy.iconname(newName=None)

Set the name of the icon for this widget. Return the name if None is given.

Lumpy.iconposition(x=None, y=None)

Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.

Lumpy.iconwindow(pathName=None)

Set widget PATHNAME to be displayed instead of icon. Return the current value if None is given.

Lumpy.image_names()

Return a list of all existing image names.

Lumpy.image_types()

Return a list of all available image types (e.g. phote bitmap).

Lumpy.is_opaque(classobj)[source]

check whether this class is completely opaque (restricted to _no_ instance variables)

Lumpy.keys()

Return a list of all resource names of this widget.

Lumpy.la(*args, **options)

make a label widget.

Lumpy.lb(*args, **options)

make a listbox.

Lumpy.lift(aboveThis=None)

Raise this widget in the stacking order.

Lumpy.loadtk()
Lumpy.lookup(val)[source]

check to see whether the given value is already represented by a Thing, and if so, return it.

Lumpy.lower(belowThis=None)

Lower this widget in the stacking order.

Lumpy.mainloop(n=0)

Call the mainloop of Tk.

Lumpy.make_reference()[source]

make a reference point by taking a snapshot of the current state. Subsequent diagrams will be relative to this reference.

Lumpy.make_reference2()[source]

this extra method call is here so that the reference and the snapshot we take later have the same number of frames on the stack. UGH.

Lumpy.make_stack()[source]

take a snapshot of the current state, subtract away the frames and variables that existed in the previous reference, then make a Stack.

Lumpy.maxsize(width=None, height=None)

Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

Lumpy.mb(*args, **options)

make a menubutton

Lumpy.mi(mb, label='', **options)

make a menu item

Lumpy.minsize(width=None, height=None)

Set min WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

Lumpy.nametowidget(name)

Return the Tkinter instance of a widget identified by its Tcl name NAME.

Lumpy.object_diagram(obj=None)[source]

create a new object diagram based on the current state. If an object is provided, draw the object. Otherwise, draw the current run-time stack (relative to the last reference).

Lumpy.opaque_class(classobj)[source]

restrict this class to no variables

Lumpy.opaque_module(modobj)[source]

make all classes defined in this module opaque

Lumpy.option_add(pattern, value, priority=None)

Set a VALUE (second parameter) for an option PATTERN (first parameter).

An optional third parameter gives the numeric priority (defaults to 80).

Lumpy.option_clear()

Clear the option database.

It will be reloaded if option_add is called.

Lumpy.option_get(name, className)

Return the value for an option NAME for this widget with CLASSNAME.

Values with higher priority override lower values.

Lumpy.option_readfile(fileName, priority=None)

Read file FILENAME into the option database.

An optional second parameter gives the numeric priority.

Lumpy.overrideredirect(boolean=None)

Instruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.

Lumpy.pack_propagate(flag=['_noarg_'])

Set or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned.

Lumpy.pack_slaves()

Return a list of all slaves of this widget in its packing order.

Lumpy.place_slaves()

Return a list of all slaves of this widget in its packing order.

Lumpy.popfr()

end the current frame (and return it)

Lumpy.positionfrom(who=None)

Instruct the window manager that the position of this widget shall be defined by the user if WHO is “user”, and by its own policy if WHO is “program”.

Lumpy.propagate(flag=['_noarg_'])

Set or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned.

Lumpy.protocol(name=None, func=None)

Bind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be e.g. “WM_SAVE_YOURSELF” or “WM_DELETE_WINDOW”.

Lumpy.pushfr(frame)

push a frame onto the frame stack

Lumpy.quit()

Quit the Tcl interpreter. All widgets will be destroyed.

Lumpy.rb(*args, **options)

make a radiobutton

Lumpy.readprofile(baseName, className)

Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.

Lumpy.register(thing, val)[source]

associate a value with the Thing that represents it, so that we can check later whether we have already created a Thing for a given value.

Lumpy.report_callback_exception(exc, val, tb)

Internal function. It reports exception on sys.stderr.

Lumpy.resizable(width=None, height=None)

Instruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.

Lumpy.restrict_class(classobj, vars=None)[source]

restrict this class so that when it is drawn, only the given vars are shown

Lumpy.rowconfigure(index, cnf={}, **kw)

Configure row INDEX of a grid.

Valid resources are minsize (minimum size of the row), weight (how much does additional space propagate to this row) and pad (how much space to let additionally).

Lumpy.rowweights(weights)

attach weights to the rows of the current grid. These weights control how the rows in the grid expand when the grid expands. The default weight is 0, which means that the row doesn’t expand. If only one row has a value, it gets all the extra space.

Lumpy.sb(*args, **options)

make a text scrollbar

Lumpy.sc(*args, **options)

make a scrollable canvas. The options provided apply to the frame only; if you want to configure the other widgets, you have to do it after invoking st

Lumpy.selection_clear(**kw)

Clear the current X selection.

Lumpy.selection_get(**kw)

Return the contents of the current X selection.

A keyword parameter selection specifies the name of the selection and defaults to PRIMARY. A keyword parameter displayof specifies a widget on the display to use.

Lumpy.selection_handle(command, **kw)

Specify a function COMMAND to call if the X selection owned by this widget is queried by another application.

This function must return the contents of the selection. The function will be called with the arguments OFFSET and LENGTH which allows the chunking of very long selections. The following keyword parameters can be provided: selection - name of the selection (default PRIMARY), type - type of the selection (e.g. STRING, FILE_NAME).

Lumpy.selection_own(**kw)

Become owner of X selection.

A keyword parameter selection specifies the name of the selection (default PRIMARY).

Lumpy.selection_own_get(**kw)

Return owner of X selection.

The following keyword parameter can be provided: selection - name of the selection (default PRIMARY), type - type of the selection (e.g. STRING, FILE_NAME).

Lumpy.send(interp, cmd, *args)

Send Tcl command CMD to different interpreter INTERP to be executed.

Lumpy.setvar(name='PY_VAR', value='1')

Set Tcl variable NAME to VALUE.

Lumpy.size()

Return a tuple of the number of column and rows in the grid.

Lumpy.sizefrom(who=None)

Instruct the window manager that the size of this widget shall be defined by the user if WHO is “user”, and by its own policy if WHO is “program”.

Lumpy.slaves()

Return a list of all slaves of this widget in its packing order.

Lumpy.st(*args, **options)

make a scrollable text entry

Lumpy.state(newstate=None)

Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).

Lumpy.te(*args, **options)

make a text entry

Lumpy.title(string=None)

Set the title of this widget.

Lumpy.tk_bisque()

Change the color scheme to light brown as used in Tk 3.6 and before.

Lumpy.tk_focusFollowsMouse()

The widget under mouse will get automatically focus. Can not be disabled easily.

Lumpy.tk_focusNext()

Return the next widget in the focus order which follows widget which has currently the focus.

The focus order first goes to the next child, then to the children of the child recursively and then to the next sibling which is higher in the stacking order. A widget is omitted if it has the takefocus resource set to 0.

Lumpy.tk_focusPrev()

Return previous widget in the focus order. See tk_focusNext for details.

Lumpy.tk_menuBar(*args)

Do not use. Needed in Tk 3.6 and earlier.

Lumpy.tk_setPalette(*args, **kw)

Set a new color scheme for all widget elements.

A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The following keywords are valid: activeBackground, foreground, selectColor, activeForeground, highlightBackground, selectBackground, background, highlightColor, selectForeground, disabledForeground, insertBackground, troughColor.

Lumpy.tk_strictMotif(boolean=None)

Set Tcl internal variable, whether the look and feel should adhere to Motif.

A parameter of 1 means adhere to Motif (e.g. no color change if mouse passes over slider). Returns the set value.

Lumpy.tkraise(aboveThis=None)

Raise this widget in the stacking order.

Lumpy.tl(**options)

make a return a top level window.

Lumpy.transient(master=None)

Instruct the window manager that this widget is transient with regard to widget MASTER.

Lumpy.transparent_class(classobj)[source]

remove the given type or class from the dictionary, which means that it’s attributes will be shown. If it is not in the dictionary, raise an exception.

Lumpy.unbind(sequence, funcid=None)

Unbind for this widget for event SEQUENCE the function identified with FUNCID.

Lumpy.unbind_all(sequence)

Unbind for all widgets for event SEQUENCE all functions.

Lumpy.unbind_class(className, sequence)

Unbind for a all widgets with bindtag CLASSNAME for event SEQUENCE all functions.

Lumpy.update()

Enter event loop until all pending events have been processed by Tcl.

Lumpy.update_idletasks()

Enter event loop until all idle callbacks have been called. This will update the display of windows but not process events caused by the user.

Lumpy.wait_variable(name='PY_VAR')

Wait until the variable is modified.

A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.

Lumpy.wait_visibility(window=None)

Wait until the visibility of a WIDGET changes (e.g. it appears).

If no parameter is given self is used.

Lumpy.wait_window(window=None)

Wait until a WIDGET is destroyed.

If no parameter is given self is used.

Lumpy.waitvar(name='PY_VAR')

Wait until the variable is modified.

A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.

Lumpy.widget(constructor, *args, **options)

this is the kernel of the widget constructors. (constructor) is the function that will be called to build the new widget. (args) is rolled into (options), and then (options) is split into widget options, pack options and grid options

Lumpy.winfo_atom(name, displayof=0)

Return integer which represents atom NAME.

Lumpy.winfo_atomname(id, displayof=0)

Return name of atom with identifier ID.

Lumpy.winfo_cells()

Return number of cells in the colormap for this widget.

Lumpy.winfo_children()

Return a list of all widgets which are children of this widget.

Lumpy.winfo_class()

Return window class name of this widget.

Lumpy.winfo_colormapfull()

Return true if at the last color request the colormap was full.

Lumpy.winfo_containing(rootX, rootY, displayof=0)

Return the widget which is at the root coordinates ROOTX, ROOTY.

Lumpy.winfo_depth()

Return the number of bits per pixel.

Lumpy.winfo_exists()

Return true if this widget exists.

Lumpy.winfo_fpixels(number)

Return the number of pixels for the given distance NUMBER (e.g. “3c”) as float.

Lumpy.winfo_geometry()

Return geometry string for this widget in the form “widthxheight+X+Y”.

Lumpy.winfo_height()

Return height of this widget.

Lumpy.winfo_id()

Return identifier ID for this widget.

Lumpy.winfo_interps(displayof=0)

Return the name of all Tcl interpreters for this display.

Lumpy.winfo_ismapped()

Return true if this widget is mapped.

Lumpy.winfo_manager()

Return the window mananger name for this widget.

Lumpy.winfo_name()

Return the name of this widget.

Lumpy.winfo_parent()

Return the name of the parent of this widget.

Lumpy.winfo_pathname(id, displayof=0)

Return the pathname of the widget given by ID.

Lumpy.winfo_pixels(number)

Rounded integer value of winfo_fpixels.

Lumpy.winfo_pointerx()

Return the x coordinate of the pointer on the root window.

Lumpy.winfo_pointerxy()

Return a tuple of x and y coordinates of the pointer on the root window.

Lumpy.winfo_pointery()

Return the y coordinate of the pointer on the root window.

Lumpy.winfo_reqheight()

Return requested height of this widget.

Lumpy.winfo_reqwidth()

Return requested width of this widget.

Lumpy.winfo_rgb(color)

Return tuple of decimal values for red, green, blue for COLOR in this widget.

Lumpy.winfo_rootx()

Return x coordinate of upper left corner of this widget on the root window.

Lumpy.winfo_rooty()

Return y coordinate of upper left corner of this widget on the root window.

Lumpy.winfo_screen()

Return the screen name of this widget.

Lumpy.winfo_screencells()

Return the number of the cells in the colormap of the screen of this widget.

Lumpy.winfo_screendepth()

Return the number of bits per pixel of the root window of the screen of this widget.

Lumpy.winfo_screenheight()

Return the number of pixels of the height of the screen of this widget in pixel.

Lumpy.winfo_screenmmheight()

Return the number of pixels of the height of the screen of this widget in mm.

Lumpy.winfo_screenmmwidth()

Return the number of pixels of the width of the screen of this widget in mm.

Lumpy.winfo_screenvisual()

Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen.

Lumpy.winfo_screenwidth()

Return the number of pixels of the width of the screen of this widget in pixel.

Lumpy.winfo_server()

Return information of the X-Server of the screen of this widget in the form “XmajorRminor vendor vendorVersion”.

Lumpy.winfo_toplevel()

Return the toplevel widget of this widget.

Lumpy.winfo_viewable()

Return true if the widget and all its higher ancestors are mapped.

Lumpy.winfo_visual()

Return one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.

Lumpy.winfo_visualid()

Return the X identifier for the visual for this widget.

Lumpy.winfo_visualsavailable(includeids=0)

Return a list of all visuals available for the screen of this widget.

Each item in the list consists of a visual name (see winfo_visual), a depth and if INCLUDEIDS=1 is given also the X identifier.

Lumpy.winfo_vrootheight()

Return the height of the virtual root window associated with this widget in pixels. If there is no virtual root window return the height of the screen.

Lumpy.winfo_vrootwidth()

Return the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.

Lumpy.winfo_vrootx()

Return the x offset of the virtual root relative to the root window of the screen of this widget.

Lumpy.winfo_vrooty()

Return the y offset of the virtual root relative to the root window of the screen of this widget.

Lumpy.winfo_width()

Return the width of this widget.

Lumpy.winfo_x()

Return the x coordinate of the upper left corner of this widget in the parent.

Lumpy.winfo_y()

Return the y coordinate of the upper left corner of this widget in the parent.

Lumpy.withdraw()

Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.

Lumpy.wm_aspect(minNumer=None, minDenom=None, maxNumer=None, maxDenom=None)

Instruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple of the actual values if no argument is given.

Lumpy.wm_attributes(*args)

This subcommand returns or sets platform specific attributes

The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows:

On Windows, -disabled gets or sets whether the window is in a disabled state. -toolwindow gets or sets the style of the window to toolwindow (as defined in the MSDN). -topmost gets or sets whether this is a topmost window (displays above all other windows).

On Macintosh, XXXXX

On Unix, there are currently no special attribute values.

Lumpy.wm_client(name=None)

Store NAME in WM_CLIENT_MACHINE property of this widget. Return current value.

Lumpy.wm_colormapwindows(*wlist)

Store list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.

Lumpy.wm_command(value=None)

Store VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.

Lumpy.wm_deiconify()

Deiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.

Lumpy.wm_focusmodel(model=None)

Set focus model to MODEL. “active” means that this widget will claim the focus itself, “passive” means that the window manager shall give the focus. Return current focus model if MODEL is None.

Lumpy.wm_frame()

Return identifier for decorative frame of this widget if present.

Lumpy.wm_geometry(newGeometry=None)

Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.

Lumpy.wm_grid(baseWidth=None, baseHeight=None, widthInc=None, heightInc=None)

Instruct the window manager that this widget shall only be resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the number of grid units requested in Tk_GeometryRequest.

Lumpy.wm_group(pathName=None)

Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.

Lumpy.wm_iconbitmap(bitmap=None, default=None)

Set bitmap for the iconified widget to BITMAP. Return the bitmap if None is given.

Under Windows, the DEFAULT parameter can be used to set the icon for the widget and any descendents that don’t have an icon set explicitly. DEFAULT can be the relative path to a .ico file (example: root.iconbitmap(default=’myicon.ico’) ). See Tk documentation for more information.

Lumpy.wm_iconify()

Display widget as icon.

Lumpy.wm_iconmask(bitmap=None)

Set mask for the icon bitmap of this widget. Return the mask if None is given.

Lumpy.wm_iconname(newName=None)

Set the name of the icon for this widget. Return the name if None is given.

Lumpy.wm_iconposition(x=None, y=None)

Set the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.

Lumpy.wm_iconwindow(pathName=None)

Set widget PATHNAME to be displayed instead of icon. Return the current value if None is given.

Lumpy.wm_maxsize(width=None, height=None)

Set max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

Lumpy.wm_minsize(width=None, height=None)

Set min WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.

Lumpy.wm_overrideredirect(boolean=None)

Instruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.

Lumpy.wm_positionfrom(who=None)

Instruct the window manager that the position of this widget shall be defined by the user if WHO is “user”, and by its own policy if WHO is “program”.

Lumpy.wm_protocol(name=None, func=None)

Bind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be e.g. “WM_SAVE_YOURSELF” or “WM_DELETE_WINDOW”.

Lumpy.wm_resizable(width=None, height=None)

Instruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.

Lumpy.wm_sizefrom(who=None)

Instruct the window manager that the size of this widget shall be defined by the user if WHO is “user”, and by its own policy if WHO is “program”.

Lumpy.wm_state(newstate=None)

Query or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).

Lumpy.wm_title(string=None)

Set the title of this widget.

Lumpy.wm_transient(master=None)

Instruct the window manager that this widget is transient with regard to widget MASTER.

Lumpy.wm_withdraw()

Withdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.

class scitools.Lumpy.Mapping(lumpy, val)[source]

Bases: scitools.Lumpy.Thing

the graphical representation of a mapping type (usually a dictionary). Sequence and Instance inherit from Mapping.

Methods

bbox() the bbox of a Mapping is the bbox of its box item.
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags]) drawme is the middle part of the way objects are drawn.
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
scan_bindings(cls) scan the bindings in this mapping, looking for
scan_val(cls, val) if we find a reference to an object type, make a note
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'scan_bindings': <function scan_bindings at 0x50ecc08>, '__module__': 'scitools.Lumpy', 'scan_val': <function scan_val at 0x50ecc80>, 'drawme': <function drawme at 0x50ecb90>, '__doc__': 'the graphical representation of a mapping type (usually a\n dictionary). Sequence and Instance inherit from Mapping.', '__init__': <function __init__ at 0x50ecaa0>, 'bbox': <function bbox at 0x50ecb18>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, val)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()[source]

the bbox of a Mapping is the bbox of its box item. This is different from other Things.

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())[source]

drawme is the middle part of the way objects are drawn. Thing.draw does some prep work, invokes drawme, and then does some cleanup. draw and drawme are not allowed to modify pos.

isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

scan_bindings(cls)[source]

scan the bindings in this mapping, looking for references to other object types. cls is the Class of the object that contains this mapping

scan_val(cls, val)[source]

if we find a reference to an object type, make a note of the HAS-A relationship. If we find a reference to a container type, scan it for references.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.NumPyArray(a)[source]
__init__(a)[source]
__module__ = 'scitools.Lumpy'
class scitools.Lumpy.ObjectDiagram(lumpy=None)[source]

Bases: scitools.Lumpy.Diagram

Methods

add_arrow(arrow) append a new arrow on the list
ca(*args, **options) make a canvas for the diagram
clear()
close() close the window and exit
draw(thing) draw the given thing
draw_arrows() draw all the arrows on the list
printfile() dump the contents of the canvas to the filename in the
setup() create the gui for the diagram
update_arrows([n]) update up to n arrows (or all of them is n==None)
update_snapshot(snapshot)
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'draw': <function draw at 0x50e8de8>, 'clear': <function clear at 0x50e8e60>, '__module__': 'scitools.Lumpy', 'update_snapshot': <function update_snapshot at 0x50e8ed8>, '__doc__': None, '__init__': <function __init__ at 0x50e8d70>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy=None)[source]
__module__ = 'scitools.Lumpy'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

add_arrow(arrow)

append a new arrow on the list

ca(*args, **options)

make a canvas for the diagram

clear()[source]
close()

close the window and exit

draw(thing)[source]

draw the given thing

draw_arrows()

draw all the arrows on the list

printfile()

dump the contents of the canvas to the filename in the filename entry.

setup()

create the gui for the diagram

update_arrows(n=None)

update up to n arrows (or all of them is n==None)

update_snapshot(snapshot)[source]
class scitools.Lumpy.ParentArrow(lumpy, parent, child, **options)[source]

Bases: scitools.Lumpy.Thing

an inheritance arrow, which shows an is-a relationship between classes in a class diagram.

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag)
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
update()
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'draw': <function draw at 0x50eab18>, 'update': <function update at 0x50eab90>, '__module__': 'scitools.Lumpy', '__init__': <function __init__ at 0x50eaaa0>, '__doc__': 'an inheritance arrow, which shows an is-a relationship\n between classes in a class diagram.\n '})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, parent, child, **options)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag)[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

update()[source]
class scitools.Lumpy.ReferenceArrow(lumpy, key, val, **options)[source]

Bases: scitools.Lumpy.Thing

a reference arrow, which show a reference in an object diagram

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag)
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
update()
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'draw': <function draw at 0x50ea9b0>, 'update': <function update at 0x50eaa28>, '__module__': 'scitools.Lumpy', '__init__': <function __init__ at 0x50ea938>, '__doc__': 'a reference arrow, which show a reference in an object diagram\n '})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, key, val, **options)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag)[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

update()[source]
class scitools.Lumpy.Sequence(lumpy, val)[source]

Bases: scitools.Lumpy.Mapping

the graphical representation of a sequence type (mostly lists and tuples)

Methods

bbox() the bbox of a Mapping is the bbox of its box item.
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags]) drawme is the middle part of the way objects are drawn.
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
scan_bindings(cls) scan the bindings in this mapping, looking for
scan_val(cls, val) if we find a reference to an object type, make a note
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', '__doc__': 'the graphical representation of a sequence type (mostly\n lists and tuples)\n ', '__init__': <function __init__ at 0x50ecd70>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, val)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

the bbox of a Mapping is the bbox of its box item. This is different from other Things.

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())

drawme is the middle part of the way objects are drawn. Thing.draw does some prep work, invokes drawme, and then does some cleanup. draw and drawme are not allowed to modify pos.

isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

scan_bindings(cls)

scan the bindings in this mapping, looking for references to other object types. cls is the Class of the object that contains this mapping

scan_val(cls, val)

if we find a reference to an object type, make a note of the HAS-A relationship. If we find a reference to a container type, scan it for references.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Simple(lumpy, val)[source]

Bases: scitools.Lumpy.Thing

the graphical representation of a simple value like a number or a string

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags])
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__init__': <function __init__ at 0x50ec8c0>, '__module__': 'scitools.Lumpy', '__doc__': 'the graphical representation of a simple value like a number\n or a string', 'drawme': <function drawme at 0x50ec938>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, val)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Snapframe(tup)[source]

Bases: object

the data structure that represents a frame

Methods

subtract(other) delete all the keys in other from self
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', 'subtract': <function subtract at 0x50e8140>, '__dict__': <attribute '__dict__' of 'Snapframe' objects>, '__weakref__': <attribute '__weakref__' of 'Snapframe' objects>, '__doc__': 'the data structure that represents a frame', '__init__': <function __init__ at 0x50e80c8>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(tup)[source]
__module__ = 'scitools.Lumpy'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

subtract(other)[source]

delete all the keys in other from self

class scitools.Lumpy.Snapshot[source]

Bases: object

the data structure that represents a stack

Methods

clean(ref) Remove all the variables in the reference stack from self
spew() print the frames in this snapshot
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__module__': 'scitools.Lumpy', 'spew': <function spew at 0x50e8230>, 'clean': <function clean at 0x50e82a8>, '__dict__': <attribute '__dict__' of 'Snapshot' objects>, '__weakref__': <attribute '__weakref__' of 'Snapshot' objects>, '__doc__': 'the data structure that represents a stack', '__init__': <function __init__ at 0x50e81b8>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__()[source]

convert from the format returned by inspect to a list of frames. Drop the last three frames, which are the Lumpy functions object_diagram, make_stack, and Stack.__init__

__module__ = 'scitools.Lumpy'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

clean(ref)[source]

Remove all the variables in the reference stack from self

spew()[source]

print the frames in this snapshot

class scitools.Lumpy.Stack(lumpy, snapshot)[source]

Bases: scitools.Lumpy.Thing

The graphical representation of a stack.

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
drawme(diag, pos, flip[, tags])
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'__init__': <function __init__ at 0x50ead70>, '__module__': 'scitools.Lumpy', '__doc__': 'The graphical representation of a stack.\n ', 'drawme': <function drawme at 0x50eade8>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__(lumpy, snapshot)[source]
__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()

return the bounding box of this object if it is drawn

bind(tags=None)

create bindings for each of the items with the given tags

down(event)

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

drawme(diag, pos, flip, tags=())[source]
isdrawn()

return True if the object has been drawn

motion(event)

this callback is invoked when the user drags an item

pos()

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)

this callback is invoked when the user releases the button

class scitools.Lumpy.Thing[source]

Bases: object

the parent class for objects that have a graphical representation. Each Thing object corresponds to an item or set of items in a diagram. A Thing can only be drawn in one Diagram at a time.

Methods

bbox() return the bounding box of this object if it is drawn
bind([tags]) create bindings for each of the items with the given tags
down(event) this callback is invoked when the user clicks on an item
draw(diag, pos, flip[, tags]) draw this Thing at the given position on the given
isdrawn() return True if the object has been drawn
motion(event) this callback is invoked when the user drags an item
pos() Compute the nominal position of a Thing by getting the
set_offset(pos) the offset attribute keeps track of the offset between
up(event) this callback is invoked when the user releases the button
__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = dict_proxy({'down': <function down at 0x50ec6e0>, 'draw': <function draw at 0x50ec5f0>, 'isdrawn': <function isdrawn at 0x50ec578>, '__new__': <staticmethod object at 0x528c788>, 'up': <function up at 0x50ec7d0>, 'bind': <function bind at 0x50ec668>, '__module__': 'scitools.Lumpy', 'pos': <function pos at 0x50ec500>, 'motion': <function motion at 0x50ec758>, '__dict__': <attribute '__dict__' of 'Thing' objects>, 'things_drawn': 0, 'bbox': <function bbox at 0x50ec410>, 'things_created': 0, 'set_offset': <function set_offset at 0x50ec488>, '__doc__': 'the parent class for objects that have a graphical\n representation. Each Thing object corresponds to an item\n or set of items in a diagram. A Thing can only be drawn in\n one Diagram at a time.\n ', '__weakref__': <attribute '__weakref__' of 'Thing' objects>})
__format__()

default object formatter

__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__() <==> hash(x)
__init__

x.__init__(...) initializes x; see help(type(x)) for signature

__module__ = 'scitools.Lumpy'
static __new__(*args, **kwds)[source]

override __new__ so we can count the number of Things

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__() <==> repr(x)
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__sizeof__() → int

size of object in memory, in bytes

__str__() <==> str(x)
static __subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

bbox()[source]

return the bounding box of this object if it is drawn

bind(tags=None)[source]

create bindings for each of the items with the given tags

down(event)[source]

this callback is invoked when the user clicks on an item

draw(diag, pos, flip, tags=())[source]

draw this Thing at the given position on the given diagram with the given tags (in addition to the specific tag for this thing). flip=1 means draw left to right; flip=-1 means right to left. Return a list of Things that were drawn.

draw and drawme are not allowed to mofify pos

isdrawn()[source]

return True if the object has been drawn

motion(event)[source]

this callback is invoked when the user drags an item

pos()[source]

Compute the nominal position of a Thing by getting the current bounding box and adding the offset.

set_offset(pos)[source]

the offset attribute keeps track of the offset between the bounding box of the Thing and its nominal position, so that if the Thing is moved later, we can compute its new nominal position.

things_created = 0
things_drawn = 0
up(event)[source]

this callback is invoked when the user releases the button

scitools.Lumpy.hasclass(obj)[source]
scitools.Lumpy.hasdiag(obj)[source]
scitools.Lumpy.hasdict(obj)[source]
scitools.Lumpy.hasname(obj)[source]
scitools.Lumpy.hasslots(obj)[source]
scitools.Lumpy.iscallable(obj)[source]
scitools.Lumpy.main(script, *args, **kwds)[source]
scitools.Lumpy.make_bindings(lumpy, iterator)[source]

return a list of bindings, one for each key-value pair in iterator. The keys are made into Index objects.

scitools.Lumpy.make_kvps(lumpy, iterator)[source]

return a list of bindings, one for each key-value pair in iterator. The keys are made into Thing objects.

scitools.Lumpy.make_tags(prefix='Tag')[source]

return a tuple with a single element: a tag string with with the given prefix and a unique id as a suffix

scitools.Lumpy.make_thing(lumpy, val)[source]

return the Thing that represents this value, either by making a new one or looking up an existing one.

scitools.Lumpy.union(one, other)[source]

return a new bbox that covers one and other, assuming that the positive y direction is DOWN

This Page