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

Defining view elements from dictionary elements in TraitsUI

Is there a way to reference items in a dictionary in traitsui views? In other words, is there a way to do what I mean with the following, using a Dict trait: from traits.api import * from traitsui.api import * from…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
0
votes
1 answer

Custom view with InstanceEditor

I'm working on a dynamic Traits UI where I can select the class to use for certain instances. I've got it working nicely using an InstanceEditor with a "values" argument containing InstanceFactoryChoice instances. My problem appears when I want to…
Nurbldoff
  • 311
  • 3
  • 4
0
votes
1 answer

python TraitsUI variable number of items in view

I have a small plotting program implemented in python using TraitsUI as graphical interface (and matplotlib for plotting, but this is not important here). So I have a class Plotter(HasTraits), which is finally shown using the configure_traits()…
Lennex
  • 5
  • 2
0
votes
1 answer

current size of traitsui editor

I have a tvtk SceneEditor for a mayavi scene in my traitsui application. When defining this editor, I asked it to have size 500x500. Because of the mayavi toolbar, the scene editor itself understands that it has a smaller size than this under…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
0
votes
1 answer

should I use constructor with HasTraits subclass

I'm trying to learn how to make GUI with Traits. I'm new in object oriented programming and I'm new in Python. Most of the examples I could find on the net do not use any constructor in the Hastraits subclass. Should I forget about the def…
0
votes
1 answer

Enthought enaml tableeditor

I have an object with a custom table editor attached to the view. This table editor can have some of its column deleted by user input. When it is the case I call an update function, this function is also called at the instantiation of the…
0
votes
1 answer

Dynamic list in traitsui

I need to build a dynamic list of Enums, where each element of the list should contain the same reference Enum. Then the user can choose the value from the Enum. Here is my code: class EnumListContainer(HasTraits): values = ['a', 'b', 'c'] …
malekcellier
  • 177
  • 3
  • 10
0
votes
1 answer

Reacting to a Button Pressed by the user in a EPD Traits view?

I'm using EPD traits for a basic GUI interface. I'm able to pop up a settings window using code like this: settings_w.configure_traits(kind="livemodal") The window has 'OK' and 'Cancel' buttons and I want to do something different depending on…
Nick
  • 3,172
  • 3
  • 37
  • 49
0
votes
1 answer

traitsui file dialog changes active window

I have a large application that has many small windows. I wanted to use traitsui's file dialog to open some files from these windows. However, when I do, the file dialog correctly spawns and picks a file, but it also consistently switches the…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
0
votes
1 answer

Embedding a Traits UI gui of kind="subpanel" in another window

In the traitsui documentation it states that Blockquote A panel is very similar to a window, except that it is embedded in a larger window, which need not be a Traits UI window. Does anyone know how to make a larger window and populate it with…
mcieslak
  • 27
  • 4
0
votes
2 answers

TraitsUI TextEditor enter_set causes input to be rejected

I am trying to build a traitsui application. As part of this application, I listen to a float that the user inputs. The editor for this float by default is a TextEditor with auto_set on. However, when the user finishes inputting this number the…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
0
votes
1 answer

TraitsUI, sharing an object

I am building a gui using HasTraits objects. I have a main object, and then objects for each component of the gui. I would like to share an object across multiple components. For example, i have a main window A which has components B and C. C …
alex
  • 2,968
  • 3
  • 23
  • 25
0
votes
1 answer

Programmatically Resize Traitsui Window

I have a traitsui gui inheriting from HasTraits (with a HSplit between a mayavi plot and a panel with editable traits). When I call .configure_traits(), the size of the resulting window seems to depend on screen size only, not on content (on OS X…
christianbrodbeck
  • 2,113
  • 2
  • 19
  • 24
0
votes
0 answers

how to draw on a matplotlib canvas created in a different class

I have one class: class CalcPlot(HasTraits): display = Instance(Figure) ax1 = self.display.axes[0] x = np.linspace(0,10,11) y = np.linspace(0,10,11) self.display = ax1.plot(x,y,color='r',marker='o') …
Griff
  • 2,064
  • 5
  • 31
  • 47
0
votes
1 answer

How to update ListStrEditor in TraitsUI, or another way of displaying a list in a Python GUI?

I'm trying to learn how to use Traits for building simple UIs for my Python scripts. I want to make a programme with a list which the user can add words to with one button, or to clear the list completely with another. So far, I've used…
RobMSN
  • 87
  • 1
  • 6
1 2 3
11
12