SelectionDialog

_images/SelectionDialog.jpg
class decida.SelectionDialog.SelectionDialog(parent=None, guispecs=None, title='')

Bases: decida.DialogBase.DialogBase

synopsis:

SelectionDialog is a generic dialog for incorporating a panel of check-boxes, radio-switch boxes, and entry boxes.

SelectionDialog is used to create the XYplotx settings and annotation dialogs.

constructor arguments:

parent (Tkinter handle, default=None)

handle of frame or other widget to pack plot in. if this is not specified, top-level is created.

guispecs (list, default=None)

gui-specs

title (str, default=””)

title to be placed on dialog window

gui-specs:

list of category specs:

  • check: [“check”, <category title>, <check button specs>]
  • radio: [“radio”, <category title>, <key>, <default value>,
    <radio button specs>]
  • entry: [“entry”, <category title>, <entry specs>]

check button specs:

  • [<key>, <button label>, <default value>]

radio button specs:

  • [ <button label>, <button value> ]

entry specs:

  • [<key>, <entry label>, <default value>]

results:

  • key array returned
  • if accept button is pressed, changed results are returned in key array
  • if cancel button is pressed, default results are returned in key array
  • key array [“ACCEPT”] is True if accept was pressed else False
  • key array [“KEYS”] is list of keys in order of appearance in guispecs

example:

guispecs = [
   ["check", "Checkbox Selections", [
       ["CHECK_KEY0", "select check 0", True],
       ["CHECK_KEY1", "select check 1", True],
       ["CHECK_KEY2", "select check 2", False],
   ]],
   ["radio", "Radiobox Selections", "RADIO_KEY", "RADIO_VAL0", [
       ["select radio 0", "RADIO_VAL0"],
       ["select radio 1", "RADIO_VAL1"],
       ["select radio 2", "RADIO_VAL2"],
   ]],
   ["entry", "Entry Selections", [
       ["ENTRY_KEY0", "entry 0", 1.2],
       ["ENTRY_KEY1", "entry 1", 2.2],
       ["ENTRY_KEY2", "entry 2", 2.3],
   ]],
]
sd = SelectionDialog(title="Selection Dialog", guispecs=guispecs)
V = sd.go()

public methods:

  • public methods from DialogBase (dialog base class)