pyworkflow.gui.form module¶
This modules implements the automatic creation of protocol form GUI from its params definition.
-
class
pyworkflow.gui.form.
ComboVar
(enum)[source]¶ Bases:
object
Create a variable that display strings (for combobox) but the values are integers (for the underlying EnumParam).
-
class
pyworkflow.gui.form.
FormWindow
(title, protocol, callback, master=None, hostList=['localhost'], **kwargs)[source]¶ Bases:
pyworkflow.gui.gui.Window
This class will create the Protocol params GUI to fill in the parameters. The creation of input parameters will be based on the Protocol Form definition. This class will serve as a connection between the GUI variables (tk vars) and the Protocol variables.
- Layout:
- There are 4 main blocks that goes each one in a different row1. 1. Header: will contains the logo, title and some link buttons. 2. Common: common execution parameters of each run. 3. Params: the expert level and tabs with the Protocol parameters. 4. Buttons: buttons at bottom for close, save and execute.
-
class
pyworkflow.gui.form.
LineWidget
(row, paramName, param, window, parent, value, callback=None, visualizeCallback=None, column=0, showButtons=True)[source]¶
-
class
pyworkflow.gui.form.
MultiPointerTreeProvider
(mapper)[source]¶ Bases:
pyworkflow.gui.tree.TreeProvider
Store several pointers to objects to be used in a BoundTree and as storage from MultiPointerVar.
-
getColumns
()[source]¶ Return a list of tuples (c, w) where: c: is the column name and index w: is the column width
-
getObjectInfo
(obj)[source]¶ This function will be called by the Tree with each object that will be inserted. A dictionary should be returned with the possible following entries: ‘key’: the key value to insert in the Tree ‘text’: text of the object to be displayed
(if not passed the ‘key’ will be used)‘image’: image path to be displayed as icon (optional) ‘parent’: the object’s parent in which insert this object (optional) ‘tags’: list of tags names (optional)
-
-
class
pyworkflow.gui.form.
MultiPointerVar
(provider, tree)[source]¶ Bases:
object
Wrapper around tk.StringVar to hold object pointers. This class is related with MultiPointerTreeProvider, which stores the list of pointed objects and have the logic to add and remove from the list.
-
class
pyworkflow.gui.form.
ParamWidget
(row, paramName, param, window, parent, value, callback=None, visualizeCallback=None, column=0, showButtons=True)[source]¶ Bases:
object
For each one in the Protocol parameters, there will be one of this in the Form GUI. It is mainly composed by: A Label: put in the left column A Frame(content): in the middle column and container
of the specific components for this parameterA Frame(buttons): a container for available actions buttons It will also have a Variable that should be set when creating
the specific components
-
class
pyworkflow.gui.form.
PointerVar
(protocol)[source]¶ Bases:
object
Wrapper around tk.StringVar to hold object pointers.
-
class
pyworkflow.gui.form.
ProtocolClassTreeProvider
(protocolClassName)[source]¶ Bases:
pyworkflow.gui.tree.TreeProvider
Will implement the methods to provide the object info of subclasses objects(of className) found by mapper
-
getColumns
()[source]¶ Return a list of tuples (c, w) where: c: is the column name and index w: is the column width
-
getObjectInfo
(obj)[source]¶ This function will be called by the Tree with each object that will be inserted. A dictionary should be returned with the possible following entries: ‘key’: the key value to insert in the Tree ‘text’: text of the object to be displayed
(if not passed the ‘key’ will be used)‘image’: image path to be displayed as icon (optional) ‘parent’: the object’s parent in which insert this object (optional) ‘tags’: list of tags names (optional)
-
-
class
pyworkflow.gui.form.
QueueDialog
(window, queueDict)[source]¶ Bases:
pyworkflow.gui.dialog.Dialog
Dialog to entry the queue parameters.
-
apply
()[source]¶ process the data This method is called automatically to process the data, after the dialog is destroyed. By default, it does nothing.
-
-
class
pyworkflow.gui.form.
RelationsTreeProvider
(protocol, relationParam, selected=None)[source]¶ Bases:
pyworkflow.gui.form.SubclassesTreeProvider
Will implement the methods to provide the object info of subclasses objects(of className) found by mapper
-
class
pyworkflow.gui.form.
ScalarTreeProvider
(protocol, scalarParam, selected=None)[source]¶ Bases:
pyworkflow.gui.tree.TreeProvider
Will implement the methods to provide the object info of scalar outputs
-
CREATION_COLUMN
= 'Creation'¶
-
INFO_COLUMN
= 'Info'¶
-
getColumns
()[source]¶ Return a list of tuples (c, w) where: c: is the column name and index w: is the column width
-
getObjectInfo
(pobj)[source]¶ This function will be called by the Tree with each object that will be inserted. A dictionary should be returned with the possible following entries: ‘key’: the key value to insert in the Tree ‘text’: text of the object to be displayed
(if not passed the ‘key’ will be used)‘image’: image path to be displayed as icon (optional) ‘parent’: the object’s parent in which insert this object (optional) ‘tags’: list of tags names (optional)
-
-
class
pyworkflow.gui.form.
ScalarWithPointerVar
(protocol, changeListener)[source]¶ Bases:
tkinter.StringVar
tk.StringVar to hold object pointers and scalars.
-
trace
(mode, callback)[source]¶ Define a trace callback for the variable.
MODE is one of “r”, “w”, “u” for read, write, undefine. CALLBACK must be a function which is called when the variable is read, written or undefined.
Return the name of the callback.
This deprecated method wraps a deprecated Tcl method that will likely be removed in the future. Use trace_add() instead.
-
-
class
pyworkflow.gui.form.
SectionFrame
(master, label, callback=None, height=15, **args)[source]¶ Bases:
tkinter.Frame
This class will be used to create a frame for the Section That will have a header with red color and a content frame with white background
-
class
pyworkflow.gui.form.
SectionWidget
(form, master, section, height, callback=None, **args)[source]¶ Bases:
pyworkflow.gui.form.SectionFrame
This class will be used to create a section in FormWindow
-
class
pyworkflow.gui.form.
SubclassesTreeProvider
(protocol, pointerParam, selected=None)[source]¶ Bases:
pyworkflow.gui.tree.TreeProvider
Will implement the methods to provide the object info of subclasses objects(of className) found by mapper
-
CREATION_COLUMN
= 'Creation'¶
-
ID_COLUMN
= 'Protocol Id'¶
-
INFO_COLUMN
= 'Info'¶
-
getColumns
()[source]¶ Return a list of tuples (c, w) where: c: is the column name and index w: is the column width
-
getObjectActions
(pobj)[source]¶ Return a list of tuples (key, action) were keys are the string options that will be display in the context menu and the actions are the functions to call when the specific action is selected. The first action in the list will be taken as the default one when the element is double-clicked.
-
getObjectInfo
(pobj)[source]¶ This function will be called by the Tree with each object that will be inserted. A dictionary should be returned with the possible following entries: ‘key’: the key value to insert in the Tree ‘text’: text of the object to be displayed
(if not passed the ‘key’ will be used)‘image’: image path to be displayed as icon (optional) ‘parent’: the object’s parent in which insert this object (optional) ‘tags’: list of tags names (optional)
-
-
class
pyworkflow.gui.form.
TextVar
(text, value='')[source]¶ Bases:
object
Wrapper around tk.StringVar to bind the value of a Text widget.
-
class
pyworkflow.gui.form.
VerticalScrolledFrame
(parent, *args, **kw)[source]¶ Bases:
tkinter.Frame
A pure Tkinter scrollable frame that actually works! * Use the ‘interior’ attribute to place widgets inside the scrollable frame * Construct and pack/place/grid normally * This frame only allows vertical scrolling
-
pyworkflow.gui.form.
editObject
(self, title, root, obj, mapper)[source]¶ Show a Text area to edit the protocol label and comment.