topo.tkgui Package


tkgui Package

Tk-based graphical user interface (GUI).

This package implements a Topographica GUI based on the Tk toolkit, through the Tkinter interface to Python. The rest of Topographica does not depend on this package or any module in it, and thus other GUIs or other types of interfaces can also be used.

topo.tkgui.start(mainloop=False, banner=True, exit_on_quit=True)[source]

Start Tk and read in an options_database file (if present), then open a TopoConsole.

Does nothing if the method has previously been called (i.e. the module-level console variable is not None).

mainloop: If True, then the command-line is frozen while the GUI is open. If False, then commands can be entered at the command-line even while the GUI is operational. Default is False.


editor Module

Inheritance diagram of topo.tkgui.editor

The GUI model editor.

Tools: for the editor menu bar Objects: that can be manipulated in the canvas Window: window and canvas

Originally written by Alan Lindsay.

class topo.tkgui.editor.ArrowTool(canvas, parent=None, parambar=None)[source]

Bases: Tkinter.Frame

ArrowTool is a selectable frame containing an arrow icon and a label. It is a toolbar item in a ModelEditor that allows the user to change the GUICanvas to ‘ARROW’ mode.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

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, except on X11, where the default is to try UTF8_STRING and fall back 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.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

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.

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.

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

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.

image_names()

Return a list of all existing image names.

image_types()

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

info()

Return information about the packing options for this widget.

keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

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.

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.

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.

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

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

set_focus(focus)[source]

Change the background highlight to reflect whether this toolbar item is selected.

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.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

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.

class topo.tkgui.editor.ConnectionTool(canvas, parent=None, parambar=None)[source]

Bases: Tkinter.Frame

ConnectionTool extends Frame. It is expected to be included in a topographica model development GUI and functions as a self populating Connection toolbar. The available Connection types are listed and the user can select one. When a connection is formed between two nodes a topo.projection of the specified type is instantiated and a reference to it is stored in it’s Editor cover. Allows user to change the EditorCanvas mode to ‘CONNECTION’ mode.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

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, except on X11, where the default is to try UTF8_STRING and fall back 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.

create_connection(editor_connection, node)[source]

Connects the editor connection and the topo simulation connection.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

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.

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.

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

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.

image_names()

Return a list of all existing image names.

image_types()

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

info()

Return information about the packing options for this widget.

keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

nametowidget(name)

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

new_cover(from_node)[source]

Create an EditorProjection and return it.

If there is more than one representation for connections/ projections, the returned object will depend on the current selection.

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.

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.

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.

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

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

set_focus(focus)[source]

Change the background highlight to reflect whether this toolbar item is selected.

set_option(*args)[source]
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.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

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.

class topo.tkgui.editor.EditorCanvas(root=None, width=600, height=600)[source]

Bases: Tkinter.Canvas

EditorCanvas extends the Tk Canvas class. There are 3 modes that determine the effect of mouse events in the Canvas A Canvas can accept new objects, move objects and make connections between them. The intended use of this class is as the main canvas in a Topographica model-editing GUI.

add_object(obj)[source]

Add a new object to the Canvas.

add_object_to_back(obj)[source]

Add a new object to the Canvas at back of the list.

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.

bbox(*args)

Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses all items with tags specified as arguments.

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

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.

change_mode(char)[source]

Changes the mode of the canvas, i.e., what mouse events will do.

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, except on X11, where the default is to try UTF8_STRING and fall back 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_object(x, y)[source]

Create a new object.

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.

delete_focus(focus)[source]

Tell a connection or object to delete itself.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

dtag(*args)

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

end_connection(x, y)[source]

Determine if the connection has been dropped on an object.

end_move(x, y)[source]

If dropping an object, remove focus and refresh.

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.

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.

get_connection_xy(x, y)[source]

Return connection at given x, y (None if no connection).

get_object_xy(x, y)[source]

Return object at given x, y (or None if no object).

get_xy(x, y)[source]

Returns the connection or object at this x, y position or None if there is not one.

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.

icursor(*args)

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

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.

init_connection(x, y)[source]

Determine if click was on an object, and retain if so.

init_move(x, y)[source]

Determine if click was on an object.

insert(*args)

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

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.

key_press(event)[source]

What happens when a key is pressed.

keys()

Return a list of all resource names of this widget.

left_click(event)[source]

What is to happen if the left button is pressed.

left_click_drag(event)[source]

What is to happen if the mouse is dragged while the left button is pressed.

left_double_click(event)[source]

What is to happen if the left button is double clicked. The same for all modes - show the properties for the clicked item. Gets object or connection at this point and gives it the focus.

left_release(event)[source]

What is to happen when the left mouse button is released.

lift(*args)

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

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.

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.

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.

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.

redraw_objects(index=None)[source]

Redraw all the objects in the canvas.

If non-None, the index specifies that only the objects below that index need drawing.

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.

remove_object(obj)[source]

Remove an object from the canvas.

right_click(event)[source]

What is to happen if the right button is pressed.

right_release(event)[source]

What is to happen when the right mouse button is released (bound to the menu).

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

show_properties(focus)[source]

Show properties of an object or connection, and remove the focus.

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.

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.

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

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_connection(x, y)[source]

Update connection’s position.

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.

update_move(x, y)[source]

If dragging an object, refresh its position

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.

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 topo.tkgui.editor.EditorConnection(name, canvas, from_node)[source]

Bases: topo.tkgui.editor.EditorObject

A connection formed between 2 EditorNodes on a EditorCanvas. A EditorConnection is used to cover any topographica connection (connection / projection), and extending classes will supply a draw method and other type specific attributes.

draw()

Draw the object at the current x, y position.

in_bounds(x, y)

Return true if x,y lies within this gui object’s boundary.

objdoc()

Documentation string for this object.

class topo.tkgui.editor.EditorEP(canvas, simobj, pos, name)[source]

Bases: topo.tkgui.editor.EditorNode

Represents any topo EventProcessor as a small, fixed-size oval by default.

objdoc()

Documentation string for this object.

class topo.tkgui.editor.EditorEPConnection(name, canvas, from_node)[source]

Bases: topo.tkgui.editor.EditorConnection

Represents any topo EPConnection using a line with an arrow head in the middle.

calculate_gradient()[source]

Not implemented in this class

get_radius()[source]

Not implemented in this class

objdoc()

Documentation string for this object.

class topo.tkgui.editor.EditorNode(canvas, simobj, pos, name)[source]

Bases: topo.tkgui.editor.EditorObject

An EditorNode is used to cover any topographica node, presently this can only be a sheet. It is a sub class of EditorObject and supplies the methods required by any node to be used in a EditorCanvas. Extending classes will supply a draw method and other type specific attributes.

draw()

Draw the object at the current x, y position.

in_bounds(x, y)

Return true if x,y lies within this gui object’s boundary.

move()

Update position of object and redraw.

objdoc()

Documentation string for this object.

remove()

Remove this object from the canvas and from the Topographica simulation.

class topo.tkgui.editor.EditorObject(name, canvas, **params)[source]

Bases: object

Anything that can be added and manipulated in an EditorCanvas. Every EditorCanvas has a corresponding Topo object associated with it. An instance of this class can have the focus.

draw()[source]

Draw the object at the current x, y position.

in_bounds(x, y)[source]

Return true if x,y lies within this gui object’s boundary.

move()[source]

Update position of object and redraw.

objdoc()[source]

Documentation string for this object.

remove()[source]

Remove this object from the canvas and from the Topographica simulation.

show_properties()[source]

Show parameters frame for object.

class topo.tkgui.editor.EditorProjection(name, canvas, from_node, receptive_field=True)[source]

Bases: topo.tkgui.editor.EditorEPConnection

Represents any topo CFProjection. It is a subclass of EditorEPConnection and fills in the methods that are not defined. Can be represented by a representation of a projection’s receptive field or by a line with an arrow head in the middle; lateral projections are represented by a dotted ellipse around the center. Can determine if x,y coord is within the triangular receptive field or within an area around the arrow head. The same can be determined for a lateral projection ellipse.

objdoc()

Documentation string for this object.

class topo.tkgui.editor.EditorSheet(canvas, simobj, pos, name)[source]

Bases: topo.tkgui.editor.EditorEP

Represents any topo sheet. It is a subclass of EditorEP and fills in the methods that are not defined. It is represented by a Parallelogram in its Canvas. The colours used for drawing can be set. Uses bounding box to determine if x, y coord is within its boundary.

normalize_plot(a)[source]

Normalize an array s. In case of a constant array, ones is returned for value greater than zero, and zeros in case of value inferior or equal to zero.

objdoc()

Documentation string for this object.

class topo.tkgui.editor.ModelEditor(master, **params)[source]

Bases: param.parameterized.Parameterized

This class constructs the main editor window. It uses a instance of GUICanvas as the main editing canvas and inserts the three-option toolbar in a Frame along the left side of the window.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07b08848e8>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07b0884d60>
inspect_value = <functools.partial object at 0x2b07b0884fc8>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b0884ec0>
set_param = <functools.partial object at 0x2b07b07d1100>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.tkgui.editor.NodeTool(canvas, parent=None, parambar=None)[source]

Bases: Tkinter.Frame

NodeTool extends Frame. It is expected to be included in a topographica model development GUI and functions as a self populating Node tool. The available Sheet types are supplied to be selected from. This Tool supplies a suitable Editor cover for a node and creates the corresponding topo object.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

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, except on X11, where the default is to try UTF8_STRING and fall back 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.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

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.

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.

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

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.

image_names()

Return a list of all existing image names.

image_types()

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

info()

Return information about the packing options for this widget.

keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

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.

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.

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.

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

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

set_focus(focus)[source]

Change the background highlight to reflect whether this toolbar item is selected.

set_option(*args)[source]
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.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

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.

topo.tkgui.editor.canvas_region = (0, 0, 1200, 1200)

Size of the canvas, as a bounding box (xl yl xh yh).


featurecurvepanel Module

Inheritance diagram of topo.tkgui.featurecurvepanel

Panels for displaying tuning curves.

Uses a PlotGroup to generate the pylab plots which are currently displayed separately from the gui.


plotgrouppanel Module

Inheritance diagram of topo.tkgui.plotgrouppanel

Classes providing GUI windows for PlotGroups, allowing sets of related plots to be displayed.

topo.tkgui.plotgrouppanel.with_busy_cursor(fn)[source]

Decorator to show busy cursor for duration of fn call.


projectionpanel Module

Inheritance diagram of topo.tkgui.projectionpanel

PlotgroupPanels for displaying ProjectionSheet plotgroups.

class topo.tkgui.projectionpanel.CFProjectionPanel(master, plotgroup, **params)[source]

Bases: topo.tkgui.projectionpanel.ProjectionPanel

Panel for displaying CFProjections.

param Integer gui_desired_maximum_plot_height (allow_None=False, bounds=(0, None), constant=False, default=5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Value to provide for PlotGroup.desired_maximum_plot_height for PlotGroups opened by the GUI. Determines the initial, default scaling for the PlotGroup.
param Button Fwd (allow_None=True, constant=False, default=None, image_path=tkgui/icons/forward-2.0.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Move forward through the history of all the plots shown in this window.
param Integer maximum_plot_history_length (allow_None=False, bounds=(-1, None), constant=False, default=20, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Value of maximum plots history length. Larger number means a longer history is kept and hence more memory is used. A length of -1 means keep all.
param Button Reduce (allow_None=True, constant=False, default=None, image_path=tkgui/icons/viewmag-_2.1.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Reduce the displayed size of the current plots by about 20%. A minimum size that preserves at least one pixel per unit is enforced, to ensure that no data is lost when displaying.
param Button Enlarge (allow_None=True, constant=False, default=None, image_path=tkgui/icons/viewmag+_2.2.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Increase the displayed size of the current plots by about 20%.
param Button Refresh (allow_None=True, constant=False, default=None, image_path=tkgui/icons/redo-small.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Refresh the current plot (i.e. force the current plot to be regenerated by executing pre_plot_hooks and plot_hooks).
param Button Back (allow_None=True, constant=False, default=None, image_path=tkgui/icons/back-2.0.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Move backward through the history of all the plots shown in this window. When showing a historical plot, some functions will be disabled, because the original data is no longer available.
param Boolean dock (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
on console or not
param Boolean pretty_parameters (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=-1, readonly=False)
Whether to format parameter names, or display the variable names instead. Example use: TkParameterized.pretty_parameters=False (This causes all Parameters throughout the GUI to be displayed with variable names.)
param Button Redraw (allow_None=True, constant=False, default=None, image_path=tkgui/icons/redo-small.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Redraw the plot from existing data (i.e. execute plot_hooks only).
add_to_plotgroups_history()

If there are plots on display, and we’re not doing a history research, the plotgroup is stored in the history depending on the parameter maximum_plot_history_length. If this parameter is -1, history is unlimited (except by your machine memory!!). If it is 0, then no history is saved. If it is N, then up to N plots are saved in history.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

change_PO(extraPO)

Shadow the Parameters of extraPO.

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, except on X11, where the default is to try UTF8_STRING and fall back 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).

conditional_redraw()

Only calls redraw_plots() if auto_refresh is enabled.

conditional_refresh()

Only calls refresh() if auto_refresh is enabled.

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.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

overrides toplevel destroy, adding removal from autorefresh panels

display_labels()

Do not display labels for these plots.

display_plots()

CFProjectionPanel requires a 2D grid of plots.

enlarge_plots()

Function called by widget to increase the plot size, when possible.

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.

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.

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.

force_new_dynamic_value = <functools.partial object at 0x2b07b0969050>
forget()

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

get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_parameter_object(name, parameterized_object=None, with_source=False)

Return the Parameter object (not value) specified by name, from the source_POs in this object (or the specified parameterized_object).

If with_source=True, returns also the source parameterizedobject.

get_parameter_value(name, parameterized_object=None)

Return the value of the parameter specified by name.

If a parameterized_object is specified, looks for the parameter there. Otherwise, looks in the source_POs of this object.

get_source_po(name)

Return the Parameterized which contains the parameter ‘name’.

get_value_generator = <functools.partial object at 0x2b07b0969100>
getboolean(s)

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

getdouble

alias of float

getint

alias of int

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.

gui_get_param(param_name)

Simulate getting the parameter in the GUI.

gui_set_param(param_name, val)

Simulate setting the parameter in the GUI.

hide_param(name)

Hide the representation of Parameter ‘name’.

image_names()

Return a list of all existing image names.

image_types()

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

info()

Return information about the packing options for this widget.

inspect_value = <functools.partial object at 0x2b07b09692b8>
keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

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.

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_param(name, parent=None, widget_options={}, on_set=None, on_modify=None, **pack_options)

Create a widget for the Parameter name, configured according to widget_options, and pack()ed according to the pack_options.

Pop-up help is automatically set from the Parameter’s doc.

The widget and label (if appropriate) are enlosed in a Frame so they can be manipulated as a single unit (see the class docstring). The representation (frame,widget,label,pack_options) is returned (as well as being stored in the representations dictionary).

  • parent is an existing widget that is to be the parent

(master) of the widget created for this paramter. If no parent is specified, defaults to the originally supplied master (i.e. that set during __init__).

  • on_set is an optional function to call whenever the

Parameter’s corresponding Tkinter Variable’s trace_variable indicates that it has been set (this does not necessarily mean that the widget’s value has changed). When the widget is created, the on_set method will be called (because the creation of the widget triggers a set in Tkinter).

  • on_modify is an optional function to call whenever the

corresponding Tkinter Variable is actually changed.

widget_options specified here override anything that might have been set elsewhere (e.g. Button’s size can be overridden here if required).

Examples of use: pack_param(name) pack_param(name,side=’left’) pack_param(name,parent=frame3,on_set=some_func) pack_param(name,widget_options={‘width’:50},side=’top’,expand=’yes’,fill=’y’)

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.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

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.

plotgroup_type

alias of TemplatePlotGroup

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

projection_type

alias of CFProjection

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.

reduce_plots()

Function called by widget to reduce the plot size, when possible.

refresh_title()

Set Window title and plot frame’s title.

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.

rescale_plots()

Rescale the existing plots, without calling either the plot_hooks or the pre_plot_hooks, then display the result.

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

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

set_auto_refresh()

Add or remove this panel from the console’s auto_refresh_panels list.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b09694c8>
set_param = <functools.partial object at 0x2b07b0969310>
set_parameter_value(name, val, parameterized_object=None)

Set the value of the parameter specified by name to val.

Updates the corresponding tkvar.

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

Set Tcl variable NAME to VALUE.

sheet_type

alias of ProjectionSheet

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.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

unhide_param(name, new_pack_options={})

Un-hide the representation of Parameter ‘name’.

Any new pack options supplied overwrite the originally supplied ones, but the parent of the widget remains the same.

unpack_param(name)

Destroy the representation of Parameter ‘name’.

(unpack and then pack a param if you want to put it in a different frame; otherwise simply use hide and unhide)

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.

update_plot_frame(plots=True, labels=True, geom=False)

set geom True for any action that user would expect to lose his/her manual window size (e.g. pressing enlarge button)

classmethod valid_context()

Return True if there is at least one instance of projection_type among all projections in the simulation.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

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.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

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.

class topo.tkgui.projectionpanel.PlotMatrixPanel(master, plotgroup, **params)[source]

Bases: topo.tkgui.projectionpanel.ProjectionSheetPanel

PlotGroupPanel for visualizing an array of bitmaps, such as for a projection involving a matrix of units.

param Integer gui_desired_maximum_plot_height (allow_None=False, bounds=(0, None), constant=False, default=5, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Value to provide for PlotGroup.desired_maximum_plot_height for PlotGroups opened by the GUI. Determines the initial, default scaling for the PlotGroup.
param Button Fwd (allow_None=True, constant=False, default=None, image_path=tkgui/icons/forward-2.0.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Move forward through the history of all the plots shown in this window.
param Integer maximum_plot_history_length (allow_None=False, bounds=(-1, None), constant=False, default=20, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Value of maximum plots history length. Larger number means a longer history is kept and hence more memory is used. A length of -1 means keep all.
param Button Reduce (allow_None=True, constant=False, default=None, image_path=tkgui/icons/viewmag-_2.1.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Reduce the displayed size of the current plots by about 20%. A minimum size that preserves at least one pixel per unit is enforced, to ensure that no data is lost when displaying.
param Button Enlarge (allow_None=True, constant=False, default=None, image_path=tkgui/icons/viewmag+_2.2.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Increase the displayed size of the current plots by about 20%.
param Button Refresh (allow_None=True, constant=False, default=None, image_path=tkgui/icons/redo-small.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Refresh the current plot (i.e. force the current plot to be regenerated by executing pre_plot_hooks and plot_hooks).
param Button Back (allow_None=True, constant=False, default=None, image_path=tkgui/icons/back-2.0.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Move backward through the history of all the plots shown in this window. When showing a historical plot, some functions will be disabled, because the original data is no longer available.
param Boolean dock (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
on console or not
param Boolean pretty_parameters (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=-1, readonly=False)
Whether to format parameter names, or display the variable names instead. Example use: TkParameterized.pretty_parameters=False (This causes all Parameters throughout the GUI to be displayed with variable names.)
param Button Redraw (allow_None=True, constant=False, default=None, image_path=tkgui/icons/redo-small.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Redraw the plot from existing data (i.e. execute plot_hooks only).
add_to_plotgroups_history()

If there are plots on display, and we’re not doing a history research, the plotgroup is stored in the history depending on the parameter maximum_plot_history_length. If this parameter is -1, history is unlimited (except by your machine memory!!). If it is 0, then no history is saved. If it is N, then up to N plots are saved in history.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

change_PO(extraPO)

Shadow the Parameters of extraPO.

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, except on X11, where the default is to try UTF8_STRING and fall back 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).

conditional_redraw()

Only calls redraw_plots() if auto_refresh is enabled.

conditional_refresh()

Only calls refresh() if auto_refresh is enabled.

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.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

overrides toplevel destroy, adding removal from autorefresh panels

display_labels()[source]

Do not display labels for these plots.

display_plots()[source]

CFProjectionPanel requires a 2D grid of plots.

enlarge_plots()

Function called by widget to increase the plot size, when possible.

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.

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.

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.

force_new_dynamic_value = <functools.partial object at 0x2b07b09691b0>
forget()

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

get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_parameter_object(name, parameterized_object=None, with_source=False)

Return the Parameter object (not value) specified by name, from the source_POs in this object (or the specified parameterized_object).

If with_source=True, returns also the source parameterizedobject.

get_parameter_value(name, parameterized_object=None)

Return the value of the parameter specified by name.

If a parameterized_object is specified, looks for the parameter there. Otherwise, looks in the source_POs of this object.

get_source_po(name)

Return the Parameterized which contains the parameter ‘name’.

get_value_generator = <functools.partial object at 0x2b07b0969050>
getboolean(s)

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

getdouble

alias of float

getint

alias of int

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.

gui_get_param(param_name)

Simulate getting the parameter in the GUI.

gui_set_param(param_name, val)

Simulate setting the parameter in the GUI.

hide_param(name)

Hide the representation of Parameter ‘name’.

image_names()

Return a list of all existing image names.

image_types()

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

info()

Return information about the packing options for this widget.

inspect_value = <functools.partial object at 0x2b07b0969260>
keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

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.

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_param(name, parent=None, widget_options={}, on_set=None, on_modify=None, **pack_options)

Create a widget for the Parameter name, configured according to widget_options, and pack()ed according to the pack_options.

Pop-up help is automatically set from the Parameter’s doc.

The widget and label (if appropriate) are enlosed in a Frame so they can be manipulated as a single unit (see the class docstring). The representation (frame,widget,label,pack_options) is returned (as well as being stored in the representations dictionary).

  • parent is an existing widget that is to be the parent

(master) of the widget created for this paramter. If no parent is specified, defaults to the originally supplied master (i.e. that set during __init__).

  • on_set is an optional function to call whenever the

Parameter’s corresponding Tkinter Variable’s trace_variable indicates that it has been set (this does not necessarily mean that the widget’s value has changed). When the widget is created, the on_set method will be called (because the creation of the widget triggers a set in Tkinter).

  • on_modify is an optional function to call whenever the

corresponding Tkinter Variable is actually changed.

widget_options specified here override anything that might have been set elsewhere (e.g. Button’s size can be overridden here if required).

Examples of use: pack_param(name) pack_param(name,side=’left’) pack_param(name,parent=frame3,on_set=some_func) pack_param(name,widget_options={‘width’:50},side=’top’,expand=’yes’,fill=’y’)

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.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

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.

plotgroup_type

alias of TemplatePlotGroup

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

projection_type

alias of Projection

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.

reduce_plots()

Function called by widget to reduce the plot size, when possible.

refresh_title()

Set Window title and plot frame’s title.

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.

rescale_plots()

Rescale the existing plots, without calling either the plot_hooks or the pre_plot_hooks, then display the result.

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

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

set_auto_refresh()

Add or remove this panel from the console’s auto_refresh_panels list.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b0969310>
set_param = <functools.partial object at 0x2b07b0969628>
set_parameter_value(name, val, parameterized_object=None)

Set the value of the parameter specified by name to val.

Updates the corresponding tkvar.

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

Set Tcl variable NAME to VALUE.

sheet_type

alias of ProjectionSheet

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.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

unhide_param(name, new_pack_options={})

Un-hide the representation of Parameter ‘name’.

Any new pack options supplied overwrite the originally supplied ones, but the parent of the widget remains the same.

unpack_param(name)

Destroy the representation of Parameter ‘name’.

(unpack and then pack a param if you want to put it in a different frame; otherwise simply use hide and unhide)

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.

update_plot_frame(plots=True, labels=True, geom=False)

set geom True for any action that user would expect to lose his/her manual window size (e.g. pressing enlarge button)

classmethod valid_context()

Return True if there is at least one instance of projection_type among all projections in the simulation.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

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.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

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.

class topo.tkgui.projectionpanel.ProjectionSheetPanel(master, plotgroup, **params)[source]

Bases: topo.tkgui.templateplotgrouppanel.SheetPanel

Abstract base class for panels relating to ProjectionSheets.

param Integer gui_desired_maximum_plot_height (allow_None=False, bounds=(0, None), constant=False, default=150, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Value to provide for PlotGroup.desired_maximum_plot_height for PlotGroups opened by the GUI. Determines the initial, default scaling for the PlotGroup.
param Button Fwd (allow_None=True, constant=False, default=None, image_path=tkgui/icons/forward-2.0.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Move forward through the history of all the plots shown in this window.
param Integer maximum_plot_history_length (allow_None=False, bounds=(-1, None), constant=False, default=20, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, time_dependent=True, time_fn=<Time Time00001>)
Value of maximum plots history length. Larger number means a longer history is kept and hence more memory is used. A length of -1 means keep all.
param Button Reduce (allow_None=True, constant=False, default=None, image_path=tkgui/icons/viewmag-_2.1.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Reduce the displayed size of the current plots by about 20%. A minimum size that preserves at least one pixel per unit is enforced, to ensure that no data is lost when displaying.
param Button Enlarge (allow_None=True, constant=False, default=None, image_path=tkgui/icons/viewmag+_2.2.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Increase the displayed size of the current plots by about 20%.
param Button Refresh (allow_None=True, constant=False, default=None, image_path=tkgui/icons/redo-small.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Refresh the current plot (i.e. force the current plot to be regenerated by executing pre_plot_hooks and plot_hooks).
param Button Back (allow_None=True, constant=False, default=None, image_path=tkgui/icons/back-2.0.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Move backward through the history of all the plots shown in this window. When showing a historical plot, some functions will be disabled, because the original data is no longer available.
param Boolean dock (allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False)
on console or not
param Boolean pretty_parameters (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=-1, readonly=False)
Whether to format parameter names, or display the variable names instead. Example use: TkParameterized.pretty_parameters=False (This causes all Parameters throughout the GUI to be displayed with variable names.)
param Button Redraw (allow_None=True, constant=False, default=None, image_path=tkgui/icons/redo-small.png, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, size=(20, 20))
Redraw the plot from existing data (i.e. execute plot_hooks only).
add_to_plotgroups_history()

If there are plots on display, and we’re not doing a history research, the plotgroup is stored in the history depending on the parameter maximum_plot_history_length. If this parameter is -1, history is unlimited (except by your machine memory!!). If it is 0, then no history is saved. If it is N, then up to N plots are saved in history.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

change_PO(extraPO)

Shadow the Parameters of extraPO.

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, except on X11, where the default is to try UTF8_STRING and fall back 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).

conditional_redraw()

Only calls redraw_plots() if auto_refresh is enabled.

conditional_refresh()

Only calls refresh() if auto_refresh is enabled.

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.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

overrides toplevel destroy, adding removal from autorefresh panels

display_labels()

This function should be redefined by subclasses to match any changes made to display__plots(). Depending on the situation, it may be useful to make this function a stub, and display the labels at the same time the images are displayed.

display_plots()

This function should be redefined in subclasses for interesting things such as 2D grids.

enlarge_plots()

Function called by widget to increase the plot size, when possible.

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.

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.

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.

force_new_dynamic_value = <functools.partial object at 0x2b07b0a4b310>
forget()

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

get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_parameter_object(name, parameterized_object=None, with_source=False)

Return the Parameter object (not value) specified by name, from the source_POs in this object (or the specified parameterized_object).

If with_source=True, returns also the source parameterizedobject.

get_parameter_value(name, parameterized_object=None)

Return the value of the parameter specified by name.

If a parameterized_object is specified, looks for the parameter there. Otherwise, looks in the source_POs of this object.

get_source_po(name)

Return the Parameterized which contains the parameter ‘name’.

get_value_generator = <functools.partial object at 0x2b07b0a4b5d0>
getboolean(s)

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

getdouble

alias of float

getint

alias of int

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.

gui_get_param(param_name)

Simulate getting the parameter in the GUI.

gui_set_param(param_name, val)

Simulate setting the parameter in the GUI.

hide_param(name)

Hide the representation of Parameter ‘name’.

image_names()

Return a list of all existing image names.

image_types()

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

info()

Return information about the packing options for this widget.

inspect_value = <functools.partial object at 0x2b07b0ebf0a8>
keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

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.

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_param(name, parent=None, widget_options={}, on_set=None, on_modify=None, **pack_options)

Create a widget for the Parameter name, configured according to widget_options, and pack()ed according to the pack_options.

Pop-up help is automatically set from the Parameter’s doc.

The widget and label (if appropriate) are enlosed in a Frame so they can be manipulated as a single unit (see the class docstring). The representation (frame,widget,label,pack_options) is returned (as well as being stored in the representations dictionary).

  • parent is an existing widget that is to be the parent

(master) of the widget created for this paramter. If no parent is specified, defaults to the originally supplied master (i.e. that set during __init__).

  • on_set is an optional function to call whenever the

Parameter’s corresponding Tkinter Variable’s trace_variable indicates that it has been set (this does not necessarily mean that the widget’s value has changed). When the widget is created, the on_set method will be called (because the creation of the widget triggers a set in Tkinter).

  • on_modify is an optional function to call whenever the

corresponding Tkinter Variable is actually changed.

widget_options specified here override anything that might have been set elsewhere (e.g. Button’s size can be overridden here if required).

Examples of use: pack_param(name) pack_param(name,side=’left’) pack_param(name,parent=frame3,on_set=some_func) pack_param(name,widget_options={‘width’:50},side=’top’,expand=’yes’,fill=’y’)

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.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

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.

plotgroup_type

alias of TemplatePlotGroup

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

projection_type

alias of Projection

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.

reduce_plots()

Function called by widget to reduce the plot size, when possible.

refresh(update=True)

Main steps for generating plots in the Frame.

# if update is True, the SheetViews are re-generated

refresh_title()

Set Window title and plot frame’s title.

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.

rescale_plots()

Rescale the existing plots, without calling either the plot_hooks or the pre_plot_hooks, then display the result.

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

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

set_auto_refresh()

Add or remove this panel from the console’s auto_refresh_panels list.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b0edb368>
set_param = <functools.partial object at 0x2b07b0edb3c0>
set_parameter_value(name, val, parameterized_object=None)

Set the value of the parameter specified by name to val.

Updates the corresponding tkvar.

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

Set Tcl variable NAME to VALUE.

sheet_type

alias of ProjectionSheet

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.

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

unhide_param(name, new_pack_options={})

Un-hide the representation of Parameter ‘name’.

Any new pack options supplied overwrite the originally supplied ones, but the parent of the widget remains the same.

unpack_param(name)

Destroy the representation of Parameter ‘name’.

(unpack and then pack a param if you want to put it in a different frame; otherwise simply use hide and unhide)

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.

update_plot_frame(plots=True, labels=True, geom=False)

set geom True for any action that user would expect to lose his/her manual window size (e.g. pressing enlarge button)

classmethod valid_context()[source]

Return True if there is at least one instance of projection_type among all projections in the simulation.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

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.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

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.

topo.tkgui.projectionpanel.cmp_projections(p1, p2)[source]

Comparison function for Plots. It compares the precedence number first and then the src_name and name attributes.


templateplotgrouppanel Module

Inheritance diagram of topo.tkgui.templateplotgrouppanel

class TemplatePlotGroupPanel Panel for displaying preference maps and activity plot groups.

topo.tkgui.templateplotgrouppanel.available_plot_channels(plot)[source]

Return the channels+names of the channels that have views.


testpattern Module

Inheritance diagram of topo.tkgui.testpattern

The Test Pattern window allows input patterns to be previewed.


topoconsole Module

Inheritance diagram of topo.tkgui.topoconsole

TopoConsole class file.

class topo.tkgui.topoconsole.ControllableMenu(master=None, cnf={}, **kw)[source]

Bases: paramtk.Menu

A Menu, but where entries are accessible by name (using dictionary-style access).

** Not truly compatible with Tkinter; work in progress **

activate(index)

Activate entry at INDEX.

add(itemType, cnf={}, **kw)

See Tkinter.Menu.add(), but ‘indexname’ can also be supplied.

If supplied, indexname must be unique. If label is supplied without indexname, then label must be unique.

add_cascade(cnf={}, **kw)

Add hierarchical menu item.

add_checkbutton(cnf={}, **kw)

Add checkbutton menu item.

add_command(cnf={}, **kw)

Add command menu item.

add_radiobutton(cnf={}, **kw)

Addd radio menu item.

add_separator(cnf={}, **kw)

Add separator.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

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, except on X11, where the default is to try UTF8_STRING and fall back 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.

delete(index1, index2=None)

If index2 is not specified, deletes the menu item at index1 (an indexname or tk integer index).

If index2 is specified, deletes menu items in range(index1,index2+1).

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

entrycget(index, option)

Return the resource value of an menu item for OPTION at INDEX.

entryconfig(index, cnf=None, **kw)

Configure a menu item at INDEX.

entryconfigure(index, cnf=None, **kw)

Configure a menu item at INDEX.

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.

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.

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.

get_indexname(index)

Return the indexname, whether given an indexname or index (where index could be an int or Tkinter position e.g. ‘end’).

The returned value will be None if index refers to an unnamed entry.

get_tkinter_index(index)

Return the Tkinter index, whether given an indexname or index (where index could be an int or Tkinter position e.g. ‘end’).

getboolean(s)

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

getdouble

alias of float

getint

alias of int

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.

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(index)

Return the index of a menu item identified by INDEX.

info()

Return information about the packing options for this widget.

insert(index, itemType, cnf={}, **kw)

See Tkinter.Menu.insert(), but index can also be specified as text.

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

Add hierarchical menu item at INDEX.

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

Add checkbutton menu item at INDEX.

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

Add command menu item at INDEX.

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

Addd radio menu item at INDEX.

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

Add separator at INDEX.

invoke(index)

Invoke a menu item identified by INDEX and execute the associated command.

keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

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.

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.

post(x, y)

Display a menu at position 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.

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

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

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_popup(x, y, entry='')

Post the menu at position X,Y with entry ENTRY.

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(aboveThis=None)

Raise this widget in the stacking order.

type(index)

Return the type of the menu item at INDEX.

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.

unpost()

Unmap a menu.

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.

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.

yposition(index)

Return the y-position of the topmost pixel of the menu item at INDEX.

class topo.tkgui.topoconsole.DockManager(master=None, cnf={}, **kw)[source]

Bases: paramtk.tilewrapper.Notebook

Manages windows that can be tabs in a notebook, or toplevels.

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.

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.

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

cget(key)

Return the resource value for a KEY given as string.

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, except on X11, where the default is to try UTF8_STRING and fall back 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.

default(style, **kw)

Sets the default value of the specified option(s) in style

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

element_create(name, type, *args)

Creates a new element in the current theme of type type. The only built-in element type is image (see image(n)), although themes may define other element types (see Ttk_RegisterElementFactory).

element_names()

Returns a list of all elements defined in the current theme.

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.

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.

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(index)

Removes the tab specified by index, unmaps and unmanages the associated child window.

getboolean(s)

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

getdouble

alias of float

getint

alias of int

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.

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(index)

Returns the numeric index of the tab specified by index, or the total number of tabs if index is the string “end”.

info()

Return information about the packing options for this widget.

instate(spec=None, script=None)

Test the widget’s state. If script is not specified, returns 1 if the widget state matches statespec and 0 otherwise. If script is specified, equivalent to if {[pathName instate stateSpec]} script.

keys()

Return a list of all resource names of this widget.

layout(style, layoutSpec)

Define the widget layout for style style. See “LAYOUTS” below for the format of layoutSpec. If layoutSpec is omitted, return the layout specification for style style.

lift(aboveThis=None)

Raise this widget in the stacking order.

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(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

map_style(**kw)

Sets dynamic values of the specified option(s) in style. See “STATE MAPS”, below.

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.

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.

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.

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

select(index)

Selects the specified tab; the associated child pane will be displayed, and the previously-selected pane (if different) is unmapped.

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

state(spec=None)

Modify or inquire widget state. If stateSpec is present, sets the widget state: for each flag in stateSpec, sets the corresponding flag or clears it if prefixed by an exclamation point. Returns a new state spec indicating which flags were changed: ‘’set changes [pathName state spec] ; pathName state $changes’’ will restore pathName to the original state. If stateSpec is not specified, returns a list of the currently-enabled state flags.

tab(index, **kw)

Query or modify the options of the specific tab. If no -option is specified, returns a dictionary of the tab option values. If one -option is specified, returns the value of tha t option. Otherwise, sets the -options to the corresponding values. See TAB OPTIONS for the available options.

tabs()

Returns a list of all pane windows managed by the widget.

theme_create(name, parent=None, basedon=None)

Creates a new theme. It is an error if themeName already exists. If -parent is specified, the new theme will inherit styles, elements, and layouts from the parent theme basedon. If -settings is present, script is evaluated in the context of the new theme as per style theme settings.

theme_names()

Returns a list of the available themes.

theme_settings(name, script)

Temporarily sets the current theme to themeName, evaluate script, then restore the previous theme. Typically script simply defines styles and elements, though arbitrary Tcl code may appear.

theme_use(theme)

Sets the current theme to themeName, and refreshes all widgets.

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(aboveThis=None)

Raise this widget in the stacking order.

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.

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.

class topo.tkgui.topoconsole.PlotsMenuEntry(plotgroup, class_=<class 'topo.tkgui.templateplotgrouppanel.TemplatePlotGroupPanel'>, **params)[source]

Bases: param.parameterized.Parameterized

Stores information about a Plots menu command (including the command itself, and the plotgroup template).

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

force_new_dynamic_value = <functools.partial object at 0x2b07b1899680>
get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_value_generator = <functools.partial object at 0x2b07b1899628>
inspect_value = <functools.partial object at 0x2b07b18997e0>
message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b18991b0>
set_param = <functools.partial object at 0x2b07b1899998>
state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

class topo.tkgui.topoconsole.TopoConsole(root, exit_on_quit=True, **params)[source]

Bases: paramtk.AppWindow, paramtk.TkParameterized

Main window for the Tk-based GUI.

param Boolean pretty_parameters (allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=-1, readonly=False)
Whether to format parameter names, or display the variable names instead. Example use: TkParameterized.pretty_parameters=False (This causes all Parameters throughout the GUI to be displayed with variable names.)
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.

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.

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.

auto_refresh(update=True)[source]

Refresh all windows in auto_refresh_panels.

Panels can add and remove themselves to the list; those in the list will have their refresh() method called whenever this console’s autorefresh() is called.

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.

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

cget(key)

Return the resource value for a KEY given as string.

change_PO(extraPO)

Shadow the Parameters of extraPO.

client(name=None)

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

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, except on X11, where the default is to try UTF8_STRING and fall back to STRING.

This command is equivalent to:

selection_get(CLIPBOARD)

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.

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

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.

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.

debug(msg, *args, **kw)

Print msg merged with args as a debugging statement.

See Python’s logging module for details of message formatting.

defaults()

Return {parameter_name:parameter.default} for all non-constant Parameters.

Note that a Parameter for which instantiate==True has its default instantiated.

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.

deletecommand(name)

Internal function.

Delete the Tcl command provided in NAME.

destroy()

Destroy this and all descendants widgets.

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.

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.

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.

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.

force_new_dynamic_value = <functools.partial object at 0x2b07b18995d0>
frame()

Return identifier for decorative frame of this widget if present.

geometry(newGeometry=None)

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

get_param_values(onlychanged=False)

Return a list of name,value pairs for all Parameters of this object.

If onlychanged is True, will only return values that are not equal to the default value.

get_parameter_object(name, parameterized_object=None, with_source=False)

Return the Parameter object (not value) specified by name, from the source_POs in this object (or the specified parameterized_object).

If with_source=True, returns also the source parameterizedobject.

get_parameter_value(name, parameterized_object=None)

Return the value of the parameter specified by name.

If a parameterized_object is specified, looks for the parameter there. Otherwise, looks in the source_POs of this object.

get_source_po(name)

Return the Parameterized which contains the parameter ‘name’.

get_value_generator = <functools.partial object at 0x2b07b1899368>
getboolean(s)

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

getdouble

alias of float

getint

alias of int

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(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.

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

group(pathName=None)

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

gui_get_param(param_name)

Simulate getting the parameter in the GUI.

gui_set_param(param_name, val)

Simulate setting the parameter in the GUI.

hide_param(name)

Hide the representation of Parameter ‘name’.

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.

iconify()

Display widget as icon.

iconmask(bitmap=None)

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

iconname(newName=None)

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

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.

iconwindow(pathName=None)

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

image_names()

Return a list of all existing image names.

image_types()

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

inspect_value = <functools.partial object at 0x2b07b1899ba8>
keys()

Return a list of all resource names of this widget.

lift(aboveThis=None)

Raise this widget in the stacking order.

load_snapshot()[source]

Dialog to load a user-selected snapshot (see topo.command.load_snapshot() ).

lower(belowThis=None)

Lower this widget in the stacking order.

mainloop(n=0)

Call the mainloop of Tk.

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.

message(msg, *args, **kw)

Print msg merged with args as a message.

See Python’s logging module for details of message formatting.

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.

nametowidget(name)

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

open_location(locations)[source]

Try to open one of the specified locations in a new window of the default browser. See webbrowser module for more information.

locations should be a tuple.

open_model_editor()[source]

Start the Model editor.

open_progress_window(timer, title=None)[source]

Provide a convenient link to progress bars.

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.

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.

pack_param(name, parent=None, widget_options={}, on_set=None, on_modify=None, **pack_options)

Create a widget for the Parameter name, configured according to widget_options, and pack()ed according to the pack_options.

Pop-up help is automatically set from the Parameter’s doc.

The widget and label (if appropriate) are enlosed in a Frame so they can be manipulated as a single unit (see the class docstring). The representation (frame,widget,label,pack_options) is returned (as well as being stored in the representations dictionary).

  • parent is an existing widget that is to be the parent

(master) of the widget created for this paramter. If no parent is specified, defaults to the originally supplied master (i.e. that set during __init__).

  • on_set is an optional function to call whenever the

Parameter’s corresponding Tkinter Variable’s trace_variable indicates that it has been set (this does not necessarily mean that the widget’s value has changed). When the widget is created, the on_set method will be called (because the creation of the widget triggers a set in Tkinter).

  • on_modify is an optional function to call whenever the

corresponding Tkinter Variable is actually changed.

widget_options specified here override anything that might have been set elsewhere (e.g. Button’s size can be overridden here if required).

Examples of use: pack_param(name) pack_param(name,side=’left’) pack_param(name,parent=frame3,on_set=some_func) pack_param(name,widget_options={‘width’:50},side=’top’,expand=’yes’,fill=’y’)

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.

classmethod params(parameter_name=None)

Return the Parameters of this class as the dictionary {name: parameter_object}

Includes Parameters from this class and its superclasses.

place_slaves()

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

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”.

pprint(imports=None, prefix=' ', unknown_value='<?>', qualify=False, separator='')

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

classmethod print_param_defaults()

Print the default values of all cls’s Parameters.

print_param_values()

Print the values of all this object’s Parameters.

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.

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”.

quit()

Quit the Tcl interpreter. All widgets will be destroyed.

quit_topographica(check=True, exit_status=0)[source]

Quit topographica.

refresh_activity_windows()[source]

Update any windows with a plotgroup_key ending in ‘Activity’.

Used primarily for debugging long scripts that present a lot of activity patterns.

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.

resizable(width=None, height=None)

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

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

run_script()[source]

Dialog to run a user-selected script

The script is exec’d in __main__.__dict__ (i.e. as if it were specified on the commandline.)

run_simulation(event=None)[source]

Run the simulation for the duration specified in the ‘run for’ taggedslider.

save_snapshot()[source]

Dialog to save a snapshot (see topo.command.save_snapshot() ).

Adds the file extension .typ if not already present.

script_repr(imports=, []prefix=' ')

Variant of __repr__ designed for generating a runnable script.

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. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.

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.

classmethod set_default(param_name, value)

Set the default value of param_name.

Equivalent to setting param_name on the class.

set_dynamic_time_fn = <functools.partial object at 0x2b07b1899f70>
set_param = <functools.partial object at 0x2b07b1899d08>
set_parameter_value(name, val, parameterized_object=None)

Set the value of the parameter specified by name to val.

Updates the corresponding tkvar.

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.

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”.

slaves()

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

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

state_pop()

Restore the most recently saved state.

See state_push() for more details.

state_push()

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

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(aboveThis=None)

Raise this widget in the stacking order.

transient(master=None)

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

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.

unhide_param(name, new_pack_options={})

Un-hide the representation of Parameter ‘name’.

Any new pack options supplied overwrite the originally supplied ones, but the parent of the widget remains the same.

unpack_param(name)

Destroy the representation of Parameter ‘name’.

(unpack and then pack a param if you want to put it in a different frame; otherwise simply use hide and unhide)

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.

verbose(msg, *args, **kw)

Print msg merged with args as a verbose message.

See Python’s logging module for details of message formatting.

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.

warning(msg, *args, **kw)

Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.

See Python’s logging module for details of message formatting.

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.

withdraw()

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

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.

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.

wm_client(name=None)

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

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.

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.

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.

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.

wm_frame()

Return identifier for decorative frame of this widget if present.

wm_geometry(newGeometry=None)

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

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.

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.

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.

wm_iconify()

Display widget as icon.

wm_iconmask(bitmap=None)

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

wm_iconname(newName=None)

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

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.

wm_iconwindow(pathName=None)

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

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.

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.

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.

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”.

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”.

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.

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”.

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

wm_title(string=None)

Set the title of this widget.

wm_transient(master=None)

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

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.