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

164 questions
55
votes
1 answer

Mayavi colorbar in TraitsUI creating blank window

I'm trying to create a GUI in TraitsUI that includes two Mayavi figures. I have implemented these figures as per the multiple engines example in the Mayavi documentation. However, when I add a colorbar to one of the figures and run the GUI script it…
Siyh
  • 1,209
  • 14
  • 20
5
votes
1 answer

How to avoid memory leaks with View

With the following program: from traits.api import HasTraits, Int, Instance from traitsui.api import View class NewView(View): def __del__(self): print('deleting NewView') class A(HasTraits): new_view = Instance(NewView) def…
Yves Surrel
  • 165
  • 10
4
votes
1 answer

Can't install traits on windows, python

Windows 10 64bit I installed traitsui successfully by pip in python3.52 Qt4 must be installed to display GUI on windows, But the highest version of python Qt4 support is python3.4 So, I install python3.4, when I try to install traits by pip I got…
zpoint
  • 121
  • 1
  • 8
4
votes
1 answer

Scrollable Group with a List using TraitsUI

So I have a problem with my traitsUI code. What I want to have is a List that is shown using CheckListEditor() and is in a confined space so it could be scrollable. I need to have this List in a Group because this would be only a small part of the…
Pagirnis
  • 53
  • 6
4
votes
1 answer

How to change traitsui view dynamically in active window

I would like to set up an interface such that, upon listening to a trait, the interface will switch between different predefined View objects. Here is an example: class App(Handler): info=Instance(UIInfo) …
aestrivex
  • 4,640
  • 1
  • 23
  • 41
4
votes
1 answer

Trigger an event in Python traits package when an Array element is changed

I'm using Python's traits package, and I'm trying to figure out the right way to use the traits.trait_numeric.Array class. It's straightforward to write a subclass of traits.api.HasTraits with an Array trait, so that when the Array changes, an…
3
votes
1 answer

How to set a custom icon in a traits UI window

I'm trying to use a custom icon in the titlebar (and taskbar if possible) of a GUI made in Traits UI, however I cannot find any information on how to do so. There is an icon attribute in the Traits UI View class, but I can't get it to change…
Siyh
  • 1,209
  • 14
  • 20
3
votes
1 answer

How to enable right-click menu in TraitsUI TreeView when using adaptors?

I have modified the Adapted_tree_editor_demo.py example code to display some simple model objects using the adaptor approach. However, right-click menu options are all disabled. How can I enable them? Implementing can_delete_me() and…
Daniel Farrell
  • 7,970
  • 6
  • 34
  • 55
3
votes
1 answer

How do I enforce a minimum value on a Enthought Traits/UI Float trait?

I'm using the Enthought Traits/UI system and would like to enforce a minimum value on a Float trait, which appears in the GUI and is editable by the user.
dbanas
  • 1,309
  • 9
  • 16
3
votes
0 answers

TableEditor in traitsui; 'selected' attribute keeps pointing to None, on_trait_change does not work

Dear community members, I currently ran into a problem with the TableEditor's selected attribute (traits version 4.5.0, traitsui version 4.5.1, Ubuntu). The problem occurs only for a special kind of Matryoshka structure, which is illustrated in the…
Jan Vorac
  • 71
  • 6
3
votes
1 answer

TabularAdapter customization/notifications?

Thanks to another user here on SO (Warren Weckesser), I found a nice way to format my TabularAdapter columns. There are some other customizations I'd like to accomplish, so I thought I'd put this out to SO to see if I can get more help. The…
Steve76063
  • 197
  • 1
  • 10
3
votes
1 answer

Enthought Traits.HasTraits class as a nested dictionary?

Imagine I have the following Traits objects: from traits.api import Int, HasTraits, Instance class Foo(HasTraits): a = Int(2) b = Int(5) class Bar(HasTraits): c = Int(7) foo = Instance(Foo,()) Bar will let me access attribute a on…
Adam Hughes
  • 9,853
  • 6
  • 52
  • 89
3
votes
1 answer

Freezing (.exe) a traitsUI program, realistically feasible?

I'm trying to freeze with either cx_freeze or pyInstaller a TraitsUI program that makes use of Chaco, Traits, TraitsUI and to a lesser extent mayavi (could actually be taken out). I need this to run on mac, linux, ubuntu so am avoiding py2exe. …
Adam Hughes
  • 9,853
  • 6
  • 52
  • 89
3
votes
1 answer

Mayavi: Help in resetting mouse picker and connecting wx event to @on_trait_change

I am making a UI which involves embedding a Mayavi view in a wx frame with controls, and I'm running into some problems. To strip down the issue, I've put together a working script which is a combination of their wx embedding and red ball picker…
braymp
  • 231
  • 1
  • 11
3
votes
1 answer

Python. I get an error on Multiple inheritance

All I am trying to do is inherit from two different classes. from traits.api import HasTraits from PyQt4 import QtCore, QtGui, uic class Main_Excel_Class(HasTraits,QtGui.QMainWindow): pass I had the "metaclass conflict: the metaclass of a…
iLovePython
  • 253
  • 3
  • 14
1
2 3
10 11