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

Bases: ttk.Frame

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

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