-
Notifications
You must be signed in to change notification settings - Fork 4
TkDialog
XTensions often require multiple parameters, which are best set through a responsive user interface. Building GUIs in Python isn't complicated (Qt, wxPython, etc...) but I wanted a specific library to help me build XTensions UIs rapidly. Tkinter wasn't my first choice, but it is included by default with most Python distributions. And for simple interfaces, it is perfectly fine and suited for the job.
At its core, TkDialog uses a dictionary type object called ArrayVar(tk.Variable) as a way to interrogate and interact with the UI widgets. This easily translates widget values into specific parameters needed to make the XTension work.
TkDialog is self-contained, and is itself an application which can be used to demonstrate most of TkDialog's features and capabilities.
The UI elements I use the most are:
- Scales
- Textboxes
- Dropdown boxes (Comboboxes)
- Buttons (and occasionally radio / checkboxes)
- Matplotlib graphs when required
And some additional concepts / ideas:
- Each parameter can have an associated tickbox (e.g. "enabled")
- Some way to freeze the widget values for later use.
- Tooltips everywhere to let users know what the parameters do.
- UI validation to make the XTension more robust and interactive.
- UIs written with TkDialog can be written and tested independently of Imaris