schrodinger.ui.widget.tkinterwidget module

Schrodinger themed Tkinter widgets.

Do not import this module directly. Instead do:

import schrodinger.ui.widget as stk

button = stk.Button(...)

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.ui.widget.tkinterwidget.BooleanVar(parent)

Bases: Tkinter.BooleanVar

Class that mimics the Tkinter.BooleanVar class. It requires a parent argument in order to avoid issues with using _default_root (This is problematic because our implementation of Python gets confused about _default_root when multiple windows have been opened.

class schrodinger.ui.widget.tkinterwidget.Button(parent=None, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Button

Class that mimics the Tkinter.Button class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Canvas(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Canvas

Class that mimics the Tkinter.Canvas class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Checkbutton(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Checkbutton

Class that mimics the Tkinter.Checkbutton class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.DoubleVar(parent)

Bases: Tkinter.DoubleVar

Class that mimics the Tkinter.DoubleVar class. It requires a parent argument in order to avoid issues with using _default_root (This is problematic because our implementation of Python gets confused about _default_root when multiple windows have been opened.

class schrodinger.ui.widget.tkinterwidget.Entry(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Entry

Class that mimics the Tkinter.Entry class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.) NOTE: It is worth looking at the EntryField class in the pmwwidget module as an alternative.

class schrodinger.ui.widget.tkinterwidget.Frame(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Frame

Class that mimics the Tkinter.Frame class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.GroundClass(cnf={}, **kwargs)

Necessary method for “grounding” all of the pick toggle preset methods in the event that the GUI is run outside of Maestro (Since pick toggles are used for choosing molecules, etc. in the Workspace.)

grid(cnf={}, **kwargs)
pack(cnf={}, **kwargs)
class schrodinger.ui.widget.tkinterwidget.HorizontalBar(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Frame

Class intended to mimic the horizontal bar that divides the bottom buttons from the rest of the panel in Maestro. The class knows its best packing defaults, and can be called and packed with only a parent argument.

class schrodinger.ui.widget.tkinterwidget.IntVar(parent)

Bases: Tkinter.IntVar

Class that mimics the Tkinter.IntVar class. It requires a parent argument in order to avoid issues with using _default_root (This is problematic because our implementation of Python gets confused about _default_root when multiple windows have been opened.

class schrodinger.ui.widget.tkinterwidget.Label(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Label

Class that mimics the Tkinter.Label class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.LabelFrame(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.LabelFrame

Class that mimics the Tkinter.LabelFrame class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Listbox(parent=None, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Listbox

Class that mimics the Tkinter.Listbox class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Menu(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Menu

Class that mimics the Tkinter.Menu class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.) NOTE: If you are constructing a main menu bar, look at using the MainMenuBar class in the pmwwidget module.

class schrodinger.ui.widget.tkinterwidget.Menubutton(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Menubutton

Class that mimics the Tkinter.Menubutton class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.) NOTE: If you are constructing a main menu bar, look at using the MainMenuBar class in the pmwwidget module.

class schrodinger.ui.widget.tkinterwidget.Message(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Message

Class that mimics the Tkinter.Message class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.NoteBookButton(parent=None, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Button

Button Specifically designed for use with the Schoridinger-ized NoteBook Mega-Widget. This is not intended to be used outside of that.

class schrodinger.ui.widget.tkinterwidget.PanedWindow(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.PanedWindow

Class that mimics the Tkinter.PanedWindow class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.PhotoImage(*args, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.PhotoImage

Class that mimics the Tkinter.PhotoImage class.

class schrodinger.ui.widget.tkinterwidget.PickAtomToggle(parent, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.PickToggle

Class meant to replicate Maestro atom pick toggles.

The following options are supported:

  • pick_function: will be called when an atom is picked. Must be a callable function that accepts one argument (atom number)
  • text: text of the Checkbutton (default “Pick”)
  • pick_text: text that will be displayed in Maestro’s status area (default “Pick an atom”)
class schrodinger.ui.widget.tkinterwidget.PickBondToggle(parent, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.PickToggle

Class meant to replicate Maestro bond pick toggles.

The following options are supported:

  • pick_function: will be called when a bond is picked. Must be a callable function that accepts two arguments (atom numbers)
  • text: text of the Checkbutton (default “Pick”)
  • pick_text: text that will be displayed in Maestro’s status area (default “Pick a bond”)
class schrodinger.ui.widget.tkinterwidget.PickToggle(parent, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Checkbutton, schrodinger.ui.widget.tkinterwidget.GroundClass

Class meant to replicate Maestro pick toggles. Obsolete. Use PickAtomToggle or PickBondToggle instead

The following options are supported:
text - text of the Checkbutton (default “Pick”) command - will be run when button is checked or unchecked variable (optional) - will be modified when checked or unchecked
fullCommand()

Gets called when the checkbutton is toggled. Manages settings of all pick toggles, and then calls the user-specified command (if it exists).

on()
stop()

Uncheck the Radiobutton and stop picking

schrodinger.ui.widget.tkinterwidget.Pmw_initialise(*arg, **kwarg)
class schrodinger.ui.widget.tkinterwidget.Radiobutton(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Radiobutton

Class that mimics the Tkinter.Radiobutton class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Scale(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Scale

Class that mimics the Tkinter.Scale class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Scrollbar(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Scrollbar

Class that mimics the Tkinter.Scrollbar class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Spinbox(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Spinbox

Class that mimics the Tkinter.Spinbox class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.StringVar(parent)

Bases: Tkinter.StringVar

Class that mimics the Tkinter.StringVar class. It requires a parent argument in order to avoid issues with using _default_root (This is problematic because our implementation of Python gets confused about _default_root when multiple windows have been opened.

class schrodinger.ui.widget.tkinterwidget.TableEntry(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Entry

Class of Tkinter.Entry widget intended for use with Schrodinger Table class which is still under development. Not intended for general use.

class schrodinger.ui.widget.tkinterwidget.Text(parent=None, cnf={}, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Text

Class that mimics the Tkinter.Text class. Accepts the additional argument “environ,” which sets defaults proper for different Maestro environments (“dialog,” “asl,” “joblaunch,” and “normal” are the possible values.)

class schrodinger.ui.widget.tkinterwidget.Tk

Bases: Tkinter.Tk

This is a Schrodinger-ized Tk instance. Background colors are set as much as possible.

The instance also comes with a predefined failsafe quit function for the X button at the top of the panel. This should be overwritten in the main code body, but if the user forgets, we catch it.

This class is intended to work with the AppFramework class in the AppFramework module, but is an excellent starting point for any GUI.

destroy()
mainloop(n=0)
tofront()

Bring the window to the front and unhide it if it is hidden. Also will un-minimize the window if it is minimized. Ev:82417

class schrodinger.ui.widget.tkinterwidget.Toplevel(parent=None, **kwargs)

Bases: schrodinger.ui.widget.tkinterwidget.schroWidget, Tkinter.Toplevel

Class that mimics the Tkinter.Toplevel class.

schrodinger.ui.widget.tkinterwidget.askdirectory(parent, **options)

Ask for a directory, and return the file name

schrodinger.ui.widget.tkinterwidget.askopenfilename(parent, **options)

Ask for a filename to open

schrodinger.ui.widget.tkinterwidget.askopenfilenames(parent, **options)

Ask for multiple filenames to open

Returns a list of filenames or empty list if cancel button selected

schrodinger.ui.widget.tkinterwidget.asksaveasfilename(parent, **options)

Ask for a filename to save as

class schrodinger.ui.widget.tkinterwidget.schroWidget(type, baseclass, parent, **kwargs)

Class for all schrodinger Tkinter widgets. Takes care of retrieving defaults for different widget classes, setting proper behavior, etc.

The class has the capability to retrieve generic defaults, environment specific defaults (environ is a possible widget argument, “dialog,” “normal,” etc.), and packing or grid defaults. The widget classes below provide examples of how to use the schroWidget class.

grid(**kwargs)

We capture the grid method of the widget so that we can add our specific defaults. After the defaults are added (user-specified options overwrite defaults), the original grid function is called.

pack(**kwargs)

We capture the pack method of the widget so that we can add our specific defaults. After the defaults are added (user-specified options overwrite defaults), the original pack function is called.