fitspy.app.utils module

utilities functions related to Tkinter

fitspy.app.utils.add(obj, row, col, sticky='', padx=5, pady=3, rspan=1, cspan=1, **kwargs)

Add tkinter object at the (row, col)-position of a grid

fitspy.app.utils.add_entry(frame, row, label, val, width=5, bind_fun=None)

Add 2 columns : ‘label’ and ‘val’ associated to a binding function ‘bind_fun’ at ‘row’ (int) position in a ‘frame’ (Tk.Frame)

fitspy.app.utils.interactive_entry(root, var, fun, width=2)

Return an interactive Tkinter.Entry binded to ‘fun’

fitspy.app.utils.convert_dict_from_tk_variables(parent_dict, excluded_keys=None)

Convert a dictionary from Tkinter.Variables to standard types (thanks to a recursive processing)

class fitspy.app.utils.ToggleFrame(master, exceptions=None, **kwargs)

Bases: LabelFrame

Class dedicated to Enable/Disable LabelFrame and its related children

Construct a labelframe widget with the parent MASTER.

STANDARD OPTIONS

borderwidth, cursor, font, foreground, highlightbackground, highlightcolor, highlightthickness, padx, pady, relief, takefocus, text

WIDGET-SPECIFIC OPTIONS

background, class, colormap, container, height, labelanchor, labelwidget, visual, width

apply_state(state, parent=None)

Apply state ‘disable’ or ‘normal’ to Frame’s children widgets

disable()

Disable Frame’s children widgets

enable()

Enable Frame’s children widgets

class fitspy.app.utils.FilesSelector(root, lbox_size=None)

Bases: object

Class dedicated to the files selection

lbox

Listbox associated to the selected files

Type:

list of Listbox object

filenames

List of of filenames to work with

Type:

list of str

Parameters:
  • root (Tk.widget) – The main window associated to the FileSelector

  • lbox_size (list of 2 ints, optional) – Size (width, height) of the Listbox ‘lbox’. Default value is [30, 15]

move(key)

Move cursor selection according to key value (up or down)

add_items(filenames=None, ind_start=None)

Add items from a ‘filenames’ list

select_files(filenames=None)

Add items from selected files

select_dir(dirname=None)

Add items from a directory

remove()

Remove selected items

remove_all()

Remove all items

select_item(index, selection_clear=True)

Select item in the listbox

class fitspy.app.utils.ProgressBar(frame)

Bases: object

Class to create a progress bar

update(spectra, ntot, ncpus)

update the progressbar info during the fitspy execution