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

Dynamically changing trait

Is it possible to have two classes class SimulationDigitizer(HasTraits): width = Int(1920) height = Int(1080) name = 'Simulation' class FileDigitizer(HasTraits): Filename = File name = 'File' and another class 'Digitizer' having…
Yves Surrel
  • 193
  • 1
  • 10
0
votes
1 answer

Dynamically adding a trait with UI update

Is it possible in a configure_traits() window to have a button like 'Add integer' on which clicking will add a new integer field ready for edition in the same window?
Yves Surrel
  • 193
  • 1
  • 10
0
votes
1 answer

Can't style a modal TraitsUI window with Qt style_sheet

The following view is styled as expected def traits_view(self): style_sheet = ''' QLabel { font: 36pt "Verdana"; margin-left: 12px; } QPushButton { font: 36pt "Verdana"; …
jmilloy
  • 7,875
  • 11
  • 53
  • 86
0
votes
1 answer

How can I use a Qt4 id or class selector in the style sheet with TraitsUI?

I'm editing a TraitsUI app that uses Qt4. How can I style specific elements in the view using a style_sheet? I understand that a TraitsUI Item/Button/etc is translated into possibly several Qt Widgets. I just can't figure out how to reference…
jmilloy
  • 7,875
  • 11
  • 53
  • 86
0
votes
1 answer

Why doesn't my RangeEditor work, when I use mode='spinner'?

In a HasTraits subclass, I have the following Trait defined: tx_lane_sel = Range(0, 12) If I display it in my View, using: Item('tx_lane_sel') it works as expected, displaying a slider bar, which ranges from 0 to 12. However, if I try to display…
dbanas
  • 1,707
  • 14
  • 24
0
votes
0 answers

mayavi synchronize color transfer function between scenes

I have several different scenes, each displaying a volume render as part of the same gui. I would like to have one interface which changes the color (ctf) of all of them simultaneously. At first I tried syncing the mayavi.modules.volume.Volume…
user3391229
  • 798
  • 9
  • 17
0
votes
0 answers

mayavi inheriting MlabSceneModel Error: SceneModel may only have on active editor

I am getting too fancy for my own good and inheriting MlabSceneModel, encapsulating some parameters and interactions that are specific to my application. explicity.. MyScene(MlabSceneModel): #This part is just to give a flavor of why I would…
user3391229
  • 798
  • 9
  • 17
0
votes
2 answers

is mayavi ready for enaml or stick with traits for gui design?

I (try to) write "fairly" complicated gui's that use Mayavi for the visualization piece, which is a significant portion for my application. Since Mayavi works with traitedVTK (tvtk), traitsui is a convenient medium for producing gui's. However, most…
user3391229
  • 798
  • 9
  • 17
0
votes
1 answer

traits ui variable number of mayavi scenes and visualization of run time traits

I would like to present the user with a variable number of scenes within the GUI (arranged say horizontally) composing different views of the data, depending on runtime conditions? I really don't want to redefine the GUI, and a number of scene…
user3391229
  • 798
  • 9
  • 17
0
votes
1 answer

traits api creating new trait and trait changed behavior

I often find myself in this situation: class A:... B=class a=Instance(A,()) @on_trait_change('a')##I would really like to be able to do this def do_something(...) I think that this currently triggers if you were to reset the entirety…
user3391229
  • 798
  • 9
  • 17
0
votes
1 answer

Non-hacky solution for runtime created traits can't be displayed in View

Repeatedly I find myself in this situation, class MainDisplay(HasTraits): a=Instance(A,()) def __init__(self): self.a=A() traits_view=View(...) class A(HasTraits): i=Int() j=Int() k=Int() def __init__(self): …
user3391229
  • 798
  • 9
  • 17
0
votes
1 answer

Traitsui Qt4 Menu actions give error in linux (works on windows)

I am trying to get a traitsui/Chaco application to work on linux. It is stable and working fine on Windows. I noticed that when I run my application on linux (I am using Raspbian wheezy ) I get the below error whenever I click on a menu item that…
user2175850
  • 193
  • 2
  • 13
0
votes
0 answers

How to correctly add multiple traits to an existent wxpython gui?

If I add multiple trait controls to an existent wx gui and I run the program I click on one text edit and start typing but then my key inputs are somehow "captured" by that text edit. Even if I click elsewhere, e.g. on the other text edit, my key…
morph
  • 305
  • 2
  • 12
0
votes
1 answer

2D Range Selection Box in Chaco (Enthought)

I am trying to draw a 2D selection box on an image plot and get out the selected region. I cannot find the appropriate tool to do this. I assumed RangeSelection2D would be appropriate for this but it seems to only actually select 1 of the 2 axes. I…
user2175850
  • 193
  • 2
  • 13
0
votes
0 answers

Continuosly pressing a button in a traitsui -based GUI

I'm building a GUI for a machine with Traits and TraitsUI. I would like the machine to perform an action as long as a button on the GUI is pressed and of course having the GUI not freeze and display the outcome of this continuous action, i.e. in a…