Trees | Indices | Help |
|
---|
|
Tkinter.Misc --+ | Tkinter.Wm --+ | Tkinter.Tk --+ | widget.tkinterwidget.Tk --+ | AppFramework
The AppFramework class is basically a hull for applications.
With its own instance of a DialogParameters class, Application manages Schrodinger dialogs like start, read, and write so that the programmer is free to worry about other things. The dialogs can be manipulated at anytime to fit the needs of the programmer (please see the DialogParameters class below).
The Application class also comes with an instance of the JobParameters class (jobparam). This object is intended to be used to store all GUI settings. Please see the JobParameters class below for more information on proper usage.
In addition to these features, the AppFramework class can take arguments for Main Menu creation.
Supposing I wanted a menu of the form:
File Edit Help ^Save ^Options ^About ^Close ^^First Option ^^Second Option
When I create my AppFramework instance, I would pass the following keyword, value pair:
menu = {1: ["File", "Edit", "Help"], "File": {"Save": {"command": <command_here>}, "Close": {"command": <command_here>}, }, "Edit": {"Options": {"First Option": {"command": <command_here>}, "Second Option": {"command": <command_here>}, }, }, "Help": {"About": {"command": <command_here>}, }, }
The dictionary key 1 (int form, not string form) is the key for an ordering list. Because dictionaries are not ordered, this is needed to specify your prefered order.
AppFramework also manages the Bottom Button Bar. One more keyword for the AppFramework instance is "buttons", and would appear like:
buttons = {"start": {"command": <command_here>}, "dialog": <boolean_show_dialog?>}, "read": {"command": <command_here>}, "write": {"command": <command_here>, "dialog": <boolean_show_dialog?>}, "reset": {"command": <command_here>}, "close": {"command": <command_here>}, "help": {"command": <command_here>}, }
The six supported buttons are "start", "read", "write", "reset", "close", and "help". Any button name for which you supply a command will be created and placed in the correct location.
Non-default button names can be used by supplying a 'text' keyword.
You can also specify a command for start, read, and write buttons that will be called when the button is pressed before displaying the dialog with the 'precommand' keyword. For example, you may want to check an input before allowing the start dialog to appear. These functions should return 0 unless the dialog should not be displayed (nor the specified start/read/write function called). Any function that returns a non-zero value will halt the dialog process, and return to the GUI.
Before the user supplied command is called, if there is an associated dialog, the AppFramework presents the dialog, saves the input in the jobparam object mentioned above. Then AppFramework calls the command.
Button configuration options are:
Finally, there is an Input Frame that can be used. Please see that class below for information on proper use.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from Inherited from |
|
See class docstring.
|
Setup the item <itemname> of menu <menuname>. Creates the item or cascading menu. |
Sets defaults for unspecified button options and adds ellipses to the button text if it brings up a dialog. Raises a SyntaxError if no command is specified for the button in the button dictionary. |
Method for start button. Show dialog, process results, call command. |
Method for read button. Show dialog, process results, call command. |
Method for write button. Show dialog, process results, call command. |
Method for reset button. Reset file input frame, call command. |
Set the state of the specified button, e.g., self.setButtonState('start', 'disabled') The standard state is 'normal'. Raises a RuntimeError if the button doesn't exist or if the requested state can't be set. |
Invoke setup() for every class in the setup list Every widget in the self.setup list gets a chance to modify the appropriate values (e.g. forcefield to use, or receptor file) in the JobParameters() instance (jobparam) before the start or write functions are called. Returns True if all setup() commands return True (i.e., success). Returns False otherwise. |
Invoke setup() for specific widget, return options in a new JobParameters object Return new JobParameters instance with only options from specified widget. This is useful to retrieve arguments for a specific widget, if you only needed those arguments. Return None if setup unsuccessful |
Monitor the given jobid and show the monitor panel; if in maestro. jobid - jobid of the job to monitor showpanel - whether to bring up the Monitor panel (default True) Example: After launching the job, use the jobid to issue the command: <AppFramework_instance>.monitorJob(<jobid>) |
Display a prompt dialog window with specified text. Returns True if first button (default OK) is pressed, False otherwise. |
Display a dialog asking the user whether to overwrite existing files. Returns True if user chose to overwrite, False otherwise. Optionally specify a list of files that will be overwritten if the user presses the Overwrite button. |
If any of the files in the <files> list exists, will bring up a dialog box asking the user whether they want to overwrite them. Returns True if the user chose to overwrite or if specified files do not exist. Returns False if the user cancelled. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 6 04:50:51 2015 | http://epydoc.sourceforge.net |