pyworkflow.gui.gui module

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

Bases: Object

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

Bases: object

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

Create a Tk window. title: string to use as title for the windows. master: if not provided, the windows create will be the principal one weight: if true, the first col and row will be configured with weight=1 minsize: a minimum size for height and width icon: if not None, set the windows icon

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.

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

This function will enter in the Tk mainloop

showError(msg, header='Error', exception=None)[source]

Pops up a dialog with the error message :param msg Message to display :param header Title of the dialog :param exception: Optional. exception associated

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

Defines some specific behaviour of the style.

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.invertImage(img)[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.