pyworkflow.gui.widgets module

Some basic GUI widgets are implemented in this module. The widgets here are suppose to be used to build more complex elements.

class pyworkflow.gui.widgets.AutoScrollbar(master=None, cnf={}, **kw)[source]

Bases: tkinter.Scrollbar

“A scrollbar that hides itself if it’s not needed.

set(lo, hi)[source]

Set the fractional values of the slider position (upper and lower ends as value between 0 and 1).

class pyworkflow.gui.widgets.Button(master, text, imagePath=None, tooltip=None, **opts)[source]

Bases: tkinter.Button

setImage(imagePath)[source]
class pyworkflow.gui.widgets.ComboBox(parent, choices, values=None, initial=None, onChange=None, **kwargs)[source]

Bases: tkinter.ttk.Combobox

Extension of ttk.ComboBox to allow having different display text and values. Also adding some utils to getSelected index and value (same for set)

getIndex()[source]

Return the selected value.

getText()[source]

Return the selected option text.

getValue()[source]

Return the selected value.

setChangeCallback(callback)[source]
class pyworkflow.gui.widgets.ExplanationText(frame, text='', bg='#d9d9d9', border=0, wrap='word')[source]

Bases: tkinter.Text

Create an explanation text box

updateExpText(text, width=50)[source]
class pyworkflow.gui.widgets.GradientFrame(parent, **args)[source]

Bases: tkinter.Canvas

A gradient frame which uses a canvas to draw the background Taken from:

class pyworkflow.gui.widgets.HotButton(master, text, imagePath=None, tooltip=None, **opts)[source]

Bases: pyworkflow.gui.widgets.Button

Button having the firebrick color and some other settings.

class pyworkflow.gui.widgets.IconButton(master, text, imagePath, tooltip=None, **opts)[source]

Bases: pyworkflow.gui.widgets.HotButton

Hot button, but only with image and no border

class pyworkflow.gui.widgets.LabelSlider(master, label, from_=0, to=100, value=50, callback=None, step=0.01, length=None, labelWidth=None, tickinterval=None, showvalue=None)[source]

Bases: tkinter.ttk.Frame

Create a personalized frame that contains label, slider and label value it also keeps a variable with the value

get()[source]
highlightLabel()[source]
removeHighlightFromLabel()[source]
class pyworkflow.gui.widgets.Scrollable(master, WidgetClass, frame=True, **opts)[source]

Bases: object

This is a base class for all scrollable widgets. If it is enabled, it will wrap the widget with a frame and will add vertical and horizontal AutoScrollbar

bindWidget(widget)[source]

Make the scroll in the widget, respond to this. Useful for child widgets.

scroll(event)[source]