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
2
votes
2 answers

Inspect stack of traits for TreeView?

We're trying to assess the feasibility of this idea: We have a pretty deep stack of HasTraits objects in a modeling program. For example, if we are modeling two materials, we could access various attributes on these…
Adam Hughes
  • 14,601
  • 12
  • 83
  • 122
2
votes
1 answer

How to apportion HSplit in traitsui-generated window

In this code, there is the following: view = View(HSplit(Item('figure', editor=MPLFigureEditor(), dock='vertical'), Item('panel', style="custom"), show_labels=False, ), …
reckoner
  • 2,861
  • 3
  • 33
  • 43
2
votes
2 answers

Using function as an instance method with Enthought Traits (Python)

I would like to create an instance method based on a function, as a parameter to instance initialization, as follows: from traits.api import * class C(HasTraits): f = Function c = C(f=lambda self: self) However, if I run c.f() it says (not…
Tuomas A.
  • 91
  • 1
  • 7
2
votes
2 answers

Python+Chaco+Traits - rendering bug: unexpected fills of line plot of large data?

Using the minimal example below, the line plot of a large (some 110k points) plot I get (with python 2.7, numpy 1.5.1, chaco/enable/traits 4.3.0) is this: However, that is bizarre, because it is a line plot, and there shouldn't be any filled areas…
sdaau
  • 36,975
  • 46
  • 198
  • 278
2
votes
1 answer

What is a viable approach to receiving asynchronous sources of data for plotting with Chaco?

I'm exploring the Traits/TraitsUI/Chaco packages from Enthought as I'd like to make use of the powerful dynamic plotting facilities. I have data coming from an external source that I wish to use to update a set of Chaco plots. I've studied the…
davidA
  • 12,528
  • 9
  • 64
  • 96
2
votes
2 answers

Changing the font in Enthought TraitsUI TextEditor

I would like to change the font in a TextEditor in TraitsUI view. How can I do this? I read the (excellent) documentation, the API reference docs and asked Google for an answer, but could not find one. Platform- and toolkit-independence is not a…
Hansemann
  • 952
  • 5
  • 6
2
votes
0 answers

python-error when changing Array trait value in ArrayViewEditor

I am a rookie student using the TraitsUI module to visuanlize an Array traits. I did a slight modification to the demo code in order to update the value of Array, and I am receiving the message "IndexError: invalid index to scalar variable" BTW, I…
Bovinova
  • 21
  • 1
1
vote
1 answer

Chaco stacked bar plot with different colour for each bar and segment

I am trying to control the colour for each bar and each bar segment, in a Chaco stacked bar plot. For example, running Chaco's stacked bar plot example gives, How do I turn it into this monstrosity? I can see Chaco has ColourMapped Scatter Plot…
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
1
vote
0 answers

Mayavi multiple embedded scenes with volume render

I want to get a multiscene layout described in https://docs.enthought.com/mayavi/mayavi/auto/example_multiple_mlab_scene_models.html import numpy as np from traits.api import HasTraits, Instance, Button, \ on_trait_change from traitsui.api…
taras
  • 6,566
  • 10
  • 39
  • 50
1
vote
1 answer

pyface FileDialog with different default filename when wildcard changes

I would like to provide a user with different default file names based on the wildcard that they select. It seems that pyface.FileDialog inherits from HasTraits so I should be above to observe it's wildcard_index trait to notice the change and…
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
1
vote
2 answers

How do I make an edit_traits() GUI item responsive to changes in its dependencies?

I'm designing a HasTraits subclass with dependent properties: #!/usr/bin/env python # Example for SO question on dynamically changing Dict contents. from traits.api import HasTraits, Dict, Property, Trait, Int, cached_property from traitsui.api…
dbanas
  • 1,707
  • 14
  • 24
1
vote
1 answer

Need to either capture a traitsui "changed tab" event or have Chaco initialize a plots dimensions

I'm trying to capture a "changed tab" event from a traitsui view. I've been circling for a while now searching, googling, and reading library source code trying to see if there's a signal/event that occurs when users change which tab has focus in…
BaleineBoy
  • 41
  • 5
1
vote
1 answer

How do make a progress bar with TraitsUI and Qt5?

In the past, I used the traitsui.wx.themed_slider_editor.ThemedSliderEditor to build a progress bar with a TraitsUI application with wx backend, Item("model.progress", label="Progress", show_label=False, style='readonly', …
Daniel Farrell
  • 9,316
  • 8
  • 39
  • 62
1
vote
1 answer

How do I reset a TraitsUI python application?

I am working on a Python program which performs various calculations. There are many different parameters that need to be inputed, and it can get confusing to remember what changes you made to the different inputs. I want to have a button that…
user3451660
  • 447
  • 8
  • 17
1
vote
0 answers

How to programmatically update value in Traitsui?

I'm trying to update the value of a Traitsui variable to match a user-defined variable given via PyQt interface. This seems like something so simple, but has taken me numerous hours now. The print functions I've used here show that the traits…
ees
  • 327
  • 1
  • 17
1 2
3
11 12