pyworkflow.gui.gui module

class pyworkflow.gui.gui.Config(value=None, **kwargs)[source]

Bases: pyworkflow.object.OrderedObject

class pyworkflow.gui.gui.Window(title='', masterWindow=None, weight=True, minsize=(500, 300), icon='scipion_icon.png', **kwargs)[source]

Class to manage a Tk windows. It will encapsulates some basic creation and setup functions.

askYesNo(title, msg)[source]
configureWeights(row=0, column=0)[source]

Create a button for closing the window, setting the proper label and icon.


Create Main menu from the given MenuConfig object.


Override this method to calculate desired dimensions.


Put some function to be executed in the GUI main thread.

getImage(imgName, percent=100, maxheight=None)[source]

Override this method to respond to move events.


Override this method to respond to resize events.


This function will enter in the Tk mainloop

showError(msg, header='Error')[source]
showInfo(msg, header='Info')[source]
showWarning(msg, header='Warning')[source]
pyworkflow.gui.gui.aliasFont(fontAlias, fontKey)[source]

Set a fontAlias as another alias name of fontKey

pyworkflow.gui.gui.centerWindows(root, dim=None, refWindows=None)[source]

Center a windows in the middle of the screen or in the middle of other windows(refWindows param)

pyworkflow.gui.gui.changeFontSize(font, event, minSize=-999, maxSize=999)[source]
pyworkflow.gui.gui.changeFontSizeByDeltha(font, deltha, minSize=-999, maxSize=999)[source]
pyworkflow.gui.gui.configureWeigths(widget, row=0, column=0)[source]

This function is a shortcut to a common used pair of calls: rowconfigure and columnconfigure for making childs widgets take the space available


Return the geometry information of the windows It will be a tuple (width, height, x, y)

pyworkflow.gui.gui.getImage(imageName, imgDict=None, tkImage=True, percent=100, maxheight=None)[source]

Search for the image in the RESOURCES path list.


Read an image using Xmipp, convert to PIL and then return as expected by Tk.

pyworkflow.gui.gui.getPILImage(imageXmipp, dim=None, normalize=True)[source]

Given an image read by Xmipp, convert it to PIL.

pyworkflow.gui.gui.getTkImage(imageXmipp, filename, dim)[source]

Set some predifined common fonts. Same conditions of setFont applies here.

pyworkflow.gui.gui.setFont(fontKey, update=False, **opts)[source]

Register a tkFont and store it in a globals of this module this method should be called only after a tk.Tk() windows has been created.