TraitsUI: Traits-capable windowing framework
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.0.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.0.0.zip | 5.4 MB | Details | |
| traitsui-5.0.0.tar.gz | 5.1 MB | Details | |
| traitsui-5.0.0.tar.bz2 | 5.1 MB | Details |
Release files / traitsui-5.0.0.zip
| Download URL | traitsui-5.0.0.zip |
|---|---|
| Size | 5.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b527436fb61e2d9ad7798f78642f1fea535239998308c877d6d1cc600b14cf6
|
|
BLAKE2b-256 checksum How to use checksums |
e1c336676dad888f452b91d9b622b1591a7334d4c846808b83001db185488ff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / traitsui-5.0.0.tar.gz
| Download URL | traitsui-5.0.0.tar.gz |
|---|---|
| Size | 5.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68f73555c265c847b92a760d537a8e6e6db006e2d2ebb3a118a31008c5403abb
|
|
BLAKE2b-256 checksum How to use checksums |
4776c56656ddc363b5f2969205a340313e0b99072d9f6c9e2d2a512226e3af4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / traitsui-5.0.0.tar.bz2
| Download URL | traitsui-5.0.0.tar.bz2 |
|---|---|
| Size | 5.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ecee473b38cb108fb6720e9bf836c468e1113b0bfcc9e5a1fc403865778198f
|
|
BLAKE2b-256 checksum How to use checksums |
c0859c13850458441c9f4556c145436b168c7350dd1d4d4eaa41ab515bc32fa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |