pyworkflow.gui.project.labels module

Tree widget implementation.

class pyworkflow.gui.project.labels.EditLabelDialog(parent, title, label, **kwargs)[source]

Bases: pyworkflow.gui.dialog.Dialog

Dialog to edit a label (name, color)

apply()[source]

process the data This method is called automatically to process the data, after the dialog is destroyed. By default, it does nothing.

body(bodyFrame)[source]

create dialog body. return widget that should have initial focus. This method should be overridden, and is called by the __init__ method.

validate()[source]

validate the data This method is called automatically to validate the data before the dialog is destroyed. By default, it always validates OK.

class pyworkflow.gui.project.labels.LabelsDialog(parent, labels, **kwargs)[source]

Bases: pyworkflow.gui.dialog.ToolbarListDialog

This class extend from ListDialog to allow an extra toolbar to handle operations over the elements in the list (e.g. Edit, New, Delete).

class pyworkflow.gui.project.labels.LabelsTreeProvider(objList=None)[source]

Bases: pyworkflow.gui.tree.TreeProvider

Populate Tree from Labels.

configureTags(tree)[source]

Configure the available tags in the tree that will be setup later for each item in the tree. :returns: * Nothing

  • Adds tags to the tree for customizing
getColumns()[source]

Return a list of tuples (c, w) where: c: is the column name and index w: is the column width

getObjectActions(obj)[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(label)[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)

getObjectPreview(obj)[source]

Should return a tuple (img, desc), where img is the preview image and desc the description string.

getObjects()[source]

Return the objects that will be inserted in the Tree