Questions tagged [traitsui]

traitsui is a data-driven framework developed by Enthought for building user interfaces on top of traits in python.

Traitsui is a data-driven framework developed by Enthought for building user interfaces on top of traits in Python. The details of layout and organization are mostly abstracted from the programmer, although an API is exposed to manage some of the details.

In traitsui, statically-typed classes (using traits) can automatically generate interactive interfaces for manipulation. Object-oriented principles generally apply -- by specifying a Manager(HasTraits) class with traits such as salary=Int and job_title=String, traitsui can automatically generate a window to edit these attributes.

traitsui makes use of different widget-drawing toolkits, notably qt4 and Wx by means of the pyside and wxpython bindings to those frameworks. Thus the UIs developed have the look and feel of the native OS.

See the traitsui user manual for more: http://docs.enthought.com/traitsui/traitsui_user_manual/index.html

167 questions
1
vote
0 answers

TraitsUI SetEditor how can I access the subset the user has selected?

How can I extract the user's selection subset from TraitsUI SetEditor? If the user selects kiwi out of the available options shown below, how can I access the list ['kiwi']? The screenshot comes from running the example code,…
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
1
vote
1 answer

Combining multiple TraitsUi Views containing matplotlib figures

I am trying to build an interactive image viewer using TraitsUI. This can be done using the implementation shared by Pierre Haessig. Next, I want to present many of these Views simultaneously. A similar approach was outlined here. However, I cannot…
Vertho
  • 200
  • 1
  • 7
1
vote
1 answer

traitsui Range() fatal error with slider entry box

Below is some sample code straight from the MayaVI website on using sliders. Try putting in a number outside of the slider range for a fatal error: from numpy import arange, pi, cos, sin from traits.api import HasTraits, Range, Instance, \ …
evambivalence
  • 113
  • 1
  • 12
1
vote
0 answers

Sphinx autodoc incorrectly assigning value 'None' to class attributes, when Traits are used

I'm seeing Python class attributes incorrectly assigned the value, None, in Sphinx autodoc generated documentation, when Traits are used. I have a simple test case with instructions for observing the error,…
dbanas
  • 1,707
  • 14
  • 24
1
vote
0 answers

Traits UI: logarithmic range editor

I'm writing a graphical interface for with Traits UI in python, and I wonder if there is a simple way to make a RangeEditor behave logarithmically, i.e. to make it's "internal" scale logarithmic, but still set the actual value of the trait. I can…
Jellby
  • 2,360
  • 3
  • 27
  • 56
1
vote
0 answers

Enthought TraitsUI cursor won't update

I've started developing an older project that was orphaned and needs to be updated a bit, and am having some issues with the TraitsUI trait input factories. If I use either RangeEditor or TextEditor, as I move from entry field to entry field the…
1
vote
1 answer

Labview-like behavior

I want an object with inputs and outputs, with all outputs calculated only when needed (some outputs may depend only on a partial set of inputs, etc.), as in a Labview VI. There can be cascading relationships between outputs, e.g. the result of the…
Yves Surrel
  • 193
  • 1
  • 10
1
vote
0 answers

DataFrameEditor in traitsUI only displays index

I am investigating the DataFrameEditor in traitsui. I came across this odd behaviour and hoped someone could confirm and/or offer a solution. If I run this minimal example below: import numpy as np import pandas as pd from traits.api import…
nhodgson
  • 11
  • 2
1
vote
1 answer

How to specify the split ratio for VSplit or HSplit in TraisUI?

My view is defined as below DefaultView = View( HSplit( Item("figure", editor=MPLFigureEditor(toolbar=True), show_label=False), VGroup( Item("draw_button", show_label=False)), show_labels=False …
Yantao Xie
  • 12,300
  • 15
  • 49
  • 79
1
vote
2 answers

How are views to be formulated for nested class instances?

I'm trying to create a user interface for a class that contains instances of other classes. Here is an illustrative example: from traits.etsconfig.api import ETSConfig ETSConfig.toolkit = 'qt4' from traits.api import HasTraits, Instance,…
jim vickroy
  • 142
  • 2
  • 9
1
vote
0 answers

Why is "pip install -U --no-deps PyBERT" failing, in the setup.py file of one of PyBERT's dependencies?

One of my users is reporting the following failure, when attempting to update the PyBERT package, using: pip install -U --no-deps PyBERT > Requirement already up-to-date: pybert in > c:\anaconda2\lib\site-packages Collecting traitsui (from pybert) …
dbanas
  • 1,707
  • 14
  • 24
1
vote
2 answers

Does TreeEditor support multiple selection?

I am using a TreeEditor to represent model objects in my traitsui application. I would like the ability select multiple objects in the tree editor by holding down Shift or Ctrl and performing selections. My ultimate goal is to provide a quick way…
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
1
vote
1 answer

chaco - making several Containers show separate plots

I have written a chaco plotting class that plots some data and allows the user to interact with it. I then wanted to make a TraitsUI GUI that has several different instances of this chaco plot so that the user can have several of the plots and…
user2175850
  • 193
  • 2
  • 13
1
vote
1 answer

How to change the directory defining mapped traits

With the following definition trait = Trait('default',{key1 : val1, key2 : val2, ...}) is it possible to change afterwards the dictionary associating traits and their mapped counterparts? This would allow to have an object-wise mapping and not a…
Yves Surrel
  • 193
  • 1
  • 10
1
vote
1 answer

TraitsUI - Joining views

Reading the documentation about applying the MVC pattern with TraitsUI, I read the example MVC_demo.py. Now, I'm wondering how to manage multiple "MVC". I want to write some "includeallMVCs.py" and to have something like: import MyViewController1,…
FacundoGFlores
  • 7,858
  • 12
  • 64
  • 94