The TraitsUI project contains a toolkit-independent GUI abstraction layer, which is used to support the “visualization” features of the Traits package. Thus, you can write model in terms of the Traits API and specify a GUI in terms of the primitives supplied by TraitsUI (views, items, editors, etc.), and let TraitsUI and your selected toolkit and back-end take care of the details of displaying them.
The following GUI backends are supported:
wxPython
PyQt
PySide
Warning: In TraitsUI version 5.0 the default GUI backend will change from wx to qt4.
Example
Given a Traits model like the following:
from traits.api import HasTraits, Str, Range, Enum
class Person(HasTraits):
name = Str('Jane Doe')
age = Range(low=0)
gender = Enum('female', 'male')
person = Person(age=30)
we can use TraitsUI to specify a and display a GUI view:
from traitsui.api import Item, RangeEditor, View
person_view = View(
Item('name'),
Item('gender'),
Item('age', editor=RangeEditor(mode='spinner')),
buttons=['OK', 'Cancel'],
resizable=True,
)
person.configure_traits(view=person_view)
which creates a GUI which looks like this:
Prerequisites
If you want to run traitsui, you must also install:
Metadata
Release files for traitsui 5.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| traitsui-5.1.0.zip | 5.5 MB | Details | |
| traitsui-5.1.0.tar.gz | 5.1 MB | Details | |
| traitsui-5.1.0.tar.bz2 | 5.1 MB | Details |
Release files / traitsui-5.1.0.zip
| Download URL | traitsui-5.1.0.zip |
|---|---|
| Size | 5.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a9148278a01a11b69ec89d7e55e8c798de6e6c411f81031bb2ed23f9284f1c4
|
|
BLAKE2b-256 checksum How to use checksums |
3b15b99f06614ebef488a34a19a5c3b4f86124d85627a16a356c6017e29e4de2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / traitsui-5.1.0.tar.gz
| Download URL | traitsui-5.1.0.tar.gz |
|---|---|
| Size | 5.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f68b4a4fcc23837fda89af66a0100fb23f0574204838b4790f5109a69924fb8
|
|
BLAKE2b-256 checksum How to use checksums |
4526722de80f92e752ac12299b85b63a73888cb7db0cfe4266f01e7d999b9295
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / traitsui-5.1.0.tar.bz2
| Download URL | traitsui-5.1.0.tar.bz2 |
|---|---|
| Size | 5.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0e8f3db59dcb45a3bf4be76d3599d22964de145d385c15a8b4c8c8844f6bec8
|
|
BLAKE2b-256 checksum How to use checksums |
554f3e66c8b131ef4f1b198106f07a0bdc612d6e2a7989471994512bfad087d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |