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.gif', **kwargs)[source]

Bases: object

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

askYesNo(title, msg)[source]
close(e=None)[source]
configureWeights(row=0, column=0)[source]
createCloseButton(parent)[source]

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

createMainMenu(menuConfig)[source]

Create Main menu from the given MenuConfig object.

desiredDimensions()[source]

Override this method to calculate desired dimensions.

enqueue(func)[source]

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

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

Override this method to respond to move events.

handleResize()[source]

Override this method to respond to resize events.

classmethod registerPluginMenu(label, callback, icon=None)[source]
show(center=True)[source]

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

pyworkflow.gui.gui.getBigFont()[source]
pyworkflow.gui.gui.getDefaultFont()[source]
pyworkflow.gui.gui.getGeometry(win)[source]

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.

pyworkflow.gui.gui.getNamedFont(fontName)[source]
pyworkflow.gui.gui.hasFont(fontKey)[source]
pyworkflow.gui.gui.saveConfig(filename)[source]
pyworkflow.gui.gui.setCommonFonts(windows=None)[source]

Set some predefined 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.