schrodinger.application.mcpro.guide module¶
A simple workflow widget.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.mcpro.guide.
Guide
(master, bw_dlg_title='Warning', bw_dlg_message='Go to prior step?', bw_command=None, step=(), button_look={'bd': 1, 'state': 'disabled'}, sep_pos='top')¶ Bases:
schrodinger.ui.widget.tkinterwidget.Frame
This class provides a simplistic workflow widget. There are many meanings in the term ``workflow’‘, here it refers to a number of distinct steps going from the start to the end to accomplish a task.
How does the widget look and work in general? - You are encouraged to run this script to take a look first before reading on. From now on, I assume you have looked. - So you see this widget is composed of a few buttons connected by a few arrows. Each button represents a distinct step
in the workflow. Pressed buttons means the visited steps. An unpressed and active button means the immediate next step.
- At each moment, there is zero or one unpressed and active button.
- Going forward into the next step, you press a button down. Going backward to a prior step, you raise a pressed button.
- Often than not, a dialog is wanted to pop out to warn the GUI user when s/he tries to go backward. This feature is supported by the widget.
- In your code, each button will be hooked up to your function that takes the relief state of the particular button as the only one argument. Your function is responsible to react properly to the change of the status of the guide widget.
- A separator line can be put on the top, or bottom, or both top and bottom of the step buttons so to separate other widgets from the guide widget.
Limitation of the current implementation: - It only draws and handles linear workflow steps.
* Class attributes ******************** BUTTON_LOOK A dictionary defining the default look of the step buttons.
* Options ***************************** master - Master frame on which this widget will be drawn on. bw_dlg_title - Title of the dialog that shows warning message when the GUI user tries to go backward.
Defaults to ‘Warning’.- bw_dlg_message - Warning message shown in a dialog when the GUI user tries to go backward.
- Defaults tp ‘Go to prior step?’.
bw_command - Command that should be called before the backward warning dialog is popped out. Defaults to `None’. step - A tuple defining the steps. button_look - A dictionary defining the look of the step buttons. Defaults to `Guide.BUTTON_LOOK’. sep_pos - Position of the separator line, taking one of these values: `TOP’, `BOTTOM’, `BOTH’, `None’.
Defaults to `Top’.-
BUTTON_LOOK
= {'bd': 1, 'state': 'disabled'}¶
-
add_step
(step)¶
-
del_step
(i)¶
-
enable_next
(should_enable=True)¶
-
step_config
(step, step_to=None, command=None, **kw)¶
-
step_configure
(**kw)¶
-
step_hide
(step, step_to=None)¶
-
step_show
(step, step_to=None)¶