generic selection dialog.
synopsis:
Selection_dialog is a generic dialog for incorporating a panel of check-boxes, radio-switch boxes, and entry boxes.
Selection_dialog is used to create the XYplotx settings and annotation dialogs.
constructor arguments:
- parent (Tkinter handle) (optional, default=None)
handle of frame or other widget to pack plot in. if this is not specified, top-level is created.
- guispecs (list) (optional, default=None)
gui-specs
- title (string) (optional, 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 = Selection_dialog(title="Selection Dialog", guispecs=guispecs) V = sd.go()
public methods:
post dialog and wait for user response.