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
0
votes
1 answer

configure_traits freezes console in Spyder/Anaconda

Trying the very first example in traitsui doc: from traits.api import HasTraits, Str, Int from traitsui.api import View, Item import traitsui class SimpleEmployee(HasTraits): first_name = Str last_name = Str department = Str …
Yves Surrel
  • 193
  • 1
  • 10
0
votes
3 answers

How do I update the dictionary of a mapped trait, after I've already constructed it?

I need to update the dictionary of a mapped trait some time after initial trait creation. How do I do this? The following code: from traits.api import (HasTraits, Trait) class bar(HasTraits): zap = Trait("None", {"None": None}) def…
dbanas
  • 1,707
  • 14
  • 24
0
votes
1 answer

GraphicsContextArray missing its __swig_setmethods__ attribute?

After porting one of my Traits/UI/Chaco/Enable projects from Python2 to Python3, I'm getting the following error, which I'm having a hard time troubleshooting. I was hoping someone might have a suggestion for making forward…
dbanas
  • 1,707
  • 14
  • 24
0
votes
1 answer

Enthought traitsui. Dynamically update a list in the GUI

OK. So I have been running into this roadblock where I cant get the GUI to update based on what I am doing. I've searched extensively and tried to read but I am at my wits end almost. The closest Ive gotten is to remove the item from the…
0
votes
0 answers

How to get the selected item from List

Key code: points = List([], editor=ListStrEditor(editable=False, multi_select=False)) How can I get the selected Items? Is there an attribute of points, so I can easily get the selected item List:
0
votes
0 answers

"Do not create a new QApplication" when embedding mayavi in QT?

In the official example of "embedding mayavi in QT" http://docs.enthought.com/mayavi/mayavi/auto/example_qt_embedding.html#example-qt-embedding, the main code says: if __name__ == "__main__": # Don't create a new QApplication, it would unhook…
Alex
  • 912
  • 2
  • 7
  • 19
0
votes
1 answer

importing traitsui editor cause wx error in python

My question is identical to this unanswered question, but I wanted to add my context (package versions) and could not upvote the previous question for lack of reputation points. (Please let me know how I should have done this according to SE…
acapet
  • 98
  • 1
  • 8
0
votes
1 answer

Using TraitsUI ListEditor Factory for arbitrary collections

How can I adapt a ListEditor to list the contents of an arbitrary collection using TraitsUI? Here is a sample code from traits.api import HasStrictTraits, Instance, Int, List, Str from traitsui.api import View, Item, ListEditor, InstanceEditor from…
MindV0rtex
  • 336
  • 1
  • 9
0
votes
1 answer

Where does the Traits/UI notification exception handler put its log file?

I'm getting this, from a Traits/UI application running under Windows7Pro: > Exception occurred in traits notification handler. Please check the > log file for details. Where can I find the log file that it speaks of?
dbanas
  • 1,707
  • 14
  • 24
0
votes
1 answer

Traits NotImplemented Error

I am using Anaconda Python and installed the traits api and traits ui using conda. I am on win 7. When I try to run simple hello world type scripts, I get an error saying File "C:\Anaconda2\lib\site-packages\traits\has_traits.py", line 2172, in…
Vikas Deolaliker
  • 1,134
  • 1
  • 7
  • 6
0
votes
1 answer

Enthought InstanceEditor Demo Raises TraitError

The InstanceEditor demo example at Enthought GitHub Repository raises the following exception: Traceback (most recent call last): File "C:\Users\jgv\AppData\Local\Programs\Python\Python36\lib\site-packages\traitsui\ui.py", line 232, in…
jim vickroy
  • 142
  • 2
  • 9
0
votes
1 answer

Traits/UI (chaco) plotting application breaks, when run in a 32-bit Anaconda environment, on 64-bit Ubuntu 16.04

I have a Traits/UI (chaco) plotting application, which runs fine in the root environment of my Anaconda 64-bit installation, on 64-bit Ubuntu 16.04. However, when I try to run it from a 32-bit environment, which I created for testing, it fails. It…
dbanas
  • 1,707
  • 14
  • 24
0
votes
1 answer

How do I define the contents of a Traits/UI View programmatically?

I have a case in which I don't know the required contents (i.e. - set of Traits) of a HasTraits subclass, until program run time, because it depends upon the result of parsing a certain file with variable contents. How can I customize the View for…
dbanas
  • 1,707
  • 14
  • 24
0
votes
1 answer

Int fields becoming inaccesible, after first click-in, in Traits/UI GUI

I have a Enthought Traits/UI GUI application with several Int traits. I find that all of these allow me only one access, after program start. That is, I click in one of them and am allowed to edit the value, but just once. The next time I try to…
dbanas
  • 1,707
  • 14
  • 24
0
votes
1 answer

trait pickling with configure_traits

I use the first example code from traitsui documentation: from traits.api import HasTraits, Str, Int import traitsui class SimpleEmployee(HasTraits): first_name = Str last_name = Str department = Str employee_number = Str …
Yves Surrel
  • 193
  • 1
  • 10