pyworkflow.gui.dialog module

Module to handling Dialogs some code was taken from tkSimpleDialog

class pyworkflow.gui.dialog.Dialog(parent, title, **kwargs)[source]

Bases: tkinter.Toplevel

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(master)[source]

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

buttonbox(btnFrame)[source]
cancel(event=None)[source]
destroy()[source]

Destroy the window

getImage(imgName)[source]

A shortcut to get an image from its name

getResult()[source]
resultCancel()[source]
resultNo()[source]
resultYes()[source]
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.dialog.EditObjectDialog(parent, title, obj, mapper, **kwargs)[source]

Bases: pyworkflow.gui.dialog.Dialog

Dialog to edit some text

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.

buttonbox(btnFrame)[source]
getComment()[source]
getLabel()[source]
class pyworkflow.gui.dialog.EntryDialog(parent, title, entryLabel, entryWidth=20, defaultValue='', headerLabel=None)[source]

Bases: pyworkflow.gui.dialog.Dialog

Dialog to ask some entry

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.dialog.FileBrowseDialog(parent, title, provider, message=None, **args)[source]

Bases: pyworkflow.gui.dialog.Dialog

Dialog to select files from the filesystem.

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.dialog.FlashMessage(master, msg, delay=5, relief='solid', func=None)[source]

Bases: object

close()[source]
process(func)[source]
class pyworkflow.gui.dialog.FloatingMessage(master, msg, xPos=750, yPos=80, textWidth=280, font='Helvetica', size=12, bd=1, bg='#6E6E6E', fg='white')[source]

Bases: object

close()[source]
show()[source]
class pyworkflow.gui.dialog.GenericDialog(master, title, msg, iconPath, **kwargs)[source]

Bases: pyworkflow.gui.dialog.Dialog

Create a dialog with many buttons Arguments:

parent – a parent window (the application window) title – the dialog title msg – message to display into the dialog iconPath – path of the image to show into the dialog
**args accepts:

buttons – list of buttons tuples containing which buttons to display and theirs values icons – list of icons for all buttons default – button default

Example:
buttons=[(‘Single’, RESULT_RUN_SINGLE),
(‘All’, RESULT_RUN_ALL), (‘Cancel’, RESULT_CANCEL)],

default=’Cancel’, icons={RESULT_CANCEL: Icon.BUTTON_CANCEL,

RESULT_RUN_SINGLE: Icon.BUTTON_SELECT, RESULT_RUN_ALL: Icon.ACTION_EXECUTE})
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.

class pyworkflow.gui.dialog.ListDialog(parent, title, provider, message=None, **kwargs)[source]

Bases: pyworkflow.gui.dialog.Dialog

Dialog to select an element from a list. It is implemented using the Tree widget.

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.dialog.MessageDialog(parent, title, msg, iconPath, **args)[source]

Bases: pyworkflow.gui.dialog.Dialog

Dialog subclasses to show message info, questions or errors. It can display an icon with the message

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.

class pyworkflow.gui.dialog.ToolbarButton(text, command, icon=None, tooltip=None)[source]

Bases: object

Store information about the buttons that will be added to the toolbar.

class pyworkflow.gui.dialog.ToolbarListDialog(parent, title, provider, message=None, toolbarButtons=None, **kwargs)[source]

Bases: pyworkflow.gui.dialog.ListDialog

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

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.

class pyworkflow.gui.dialog.YesNoDialog(master, title, msg, **kwargs)[source]

Bases: pyworkflow.gui.dialog.MessageDialog

Ask a question with YES/NO answer

pyworkflow.gui.dialog.askColor(defaultColor='black')[source]
pyworkflow.gui.dialog.askSingleAllCancel(title, msg, parent)[source]
pyworkflow.gui.dialog.askString(title, label, parent, entryWidth=20, defaultValue='', headerLabel=None)[source]
pyworkflow.gui.dialog.askYesNo(title, msg, parent)[source]
pyworkflow.gui.dialog.askYesNoCancel(title, msg, parent)[source]
pyworkflow.gui.dialog.createMessageBody(bodyFrame, message, image, frameBg='white', textBg='white', textPad=5)[source]

Create a Text containing the message. Params:

bodyFrame: tk.Frame to be filled. msg: a str or list with the lines.
pyworkflow.gui.dialog.fillMessageText(text, message)[source]
pyworkflow.gui.dialog.showError(title, msg, parent)[source]
pyworkflow.gui.dialog.showInfo(title, msg, parent)[source]
pyworkflow.gui.dialog.showWarning(title, msg, parent)[source]