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
1
vote
0 answers

Delegation in Swing (Python Traits Equivalent)

I'm a long-time Python developer, and relied on Enthought's Traits/TraitsUI libraries for quick GUI development. I'm trying to understand if Swing has a similar implementation of Traits that would allow for easy delegation. Imagine I have a JFrame…
Adam Hughes
  • 14,601
  • 12
  • 83
  • 122
1
vote
1 answer

listen for ctf otf changes with traits in mayavi volume rendering

I would like to listen to changes in the transfer function in how the color and opacity (ctf/otf) of my data is represented. Listening to sensible-sounding traits such as mayavi.modules.volume.Volume._ctf does not trigger my callback. I would expect…
user3391229
  • 798
  • 9
  • 17
1
vote
0 answers

In traits.api File trait, how can I force the directory to be readonly?

I have a software that lets the user choose the database location from the traits.api File trait as shown below: class DbPreferencesHelper(PreferencesHelper): dbLocation = File() class DbPreferencesPane(PreferencesPane): view =…
Antique
  • 31
  • 2
1
vote
2 answers

Python traitsui save file dialogue - overwriting

what is the right way to implement file-saving dialogue with the traitsui package from Enthought? At the moment, I have the actual saving function watching for changes in the trait filename_out (i.e. File trait). Unsurprisingly, this does nothing…
Jan Vorac
  • 71
  • 6
1
vote
1 answer

MenuBar does not appear inside InstanceEditor

I am attempting to build a series of menus into my traitsui visualization program application. My GUI is comprised of a sequence of panels which all use different model objects, which are all displayed in the main GUI using InstanceEditors. This has…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
1
vote
1 answer

views on Nested HasTraits object

I am having trouble getting the views to work as expected, using nested HasTraits. For example: class A(HasTraits): b= Any() ... view = View(... Item('b', style='custom') ... I would like to import the class of b and assign it to A, from…
alex
  • 2,968
  • 3
  • 23
  • 25
1
vote
0 answers

Exposing pandas DataFrame to TraitsGUI Editable Table

I have noticed in the Enthought Canopy demos, there are several bits of code that expose lists and numpy arrays as a TraitsUI Editable Table. I am looking to do the same for a Pandas DataFrame. Essentially, I'd like to be able to edit a couple of…
MarkD
  • 4,864
  • 5
  • 36
  • 67
1
vote
1 answer

Changing attribute outside of traitsui GUI

i have a question about changing the attributes of traitsui GUI. For the Gui i want to change an attribute of the gui, not because of a change within the GUI. from traits.api import HasTraits, Bool, Int from traitsui.api import View, Handler class…
Python3141
  • 19
  • 2
1
vote
1 answer

visible_when with multiple logical tests

In TraitsUI, for an Item(), is it possible to setup a visible_when() parameter list with more than 1 item? For example, I'd like something like this: Group( Item(FirstItem, visible_when = 'foo == 1 and bar == 0'), Item(SecondItem,…
Steve76063
  • 317
  • 2
  • 10
1
vote
1 answer

How do I require that a user hit , when editing a Trait value, before change notifications are sent out?

I find myself waiting for the GUI of my Traits/UI application to update, with each backspace and/or digit entry in a particular field. How can I get the Traits/UI notification system to wait until I press RETURN before it sends out change…
dbanas
  • 1,707
  • 14
  • 24
1
vote
1 answer

How do I force the statusbar attribute of a Traits View object to update/redraw itself?

Ever since I switched from Canopy to Anaconda, the statusbar of my View is no longer updating itself dynamically, as my program runs. How can I force this to happen, at certain points within my program's execution? I have this: traits_view = View( …
dbanas
  • 1,707
  • 14
  • 24
1
vote
0 answers

Order of items in traitsui TableEditor

I am trying to use a traitsui TableEditor to allow the user to interact with some data. In the wx backend, the editor seems to dump things into the table in the Order they are listed in the trait being edited. But using the qt backend, the entries…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
1
vote
0 answers

Enthought TraitsUI ValueEditor - customize the values/objects displayed in the tree view

I am trying to use traitsui.api.ValueEditor to create a tree view for a dictionary: class my_editor(HasTraits): x = Any traits_view = View(Item('x', editor = ValueEditor())) a = my_editor(x = my_dict) a.configure_traits() And the…
Evelyn Liu
  • 21
  • 4
1
vote
1 answer

Inspect for synchronized traits: Traits/TraitsUI

I'm sweeping through all the Traits in a large program, and many of our traits are synchronized. For example, consider HasTrait objects of the structure: a = Material1.ShellMaterial b = Material2.CoreMaterial c = Material3.MaterialX In our…
Adam Hughes
  • 14,601
  • 12
  • 83
  • 122
1
vote
1 answer

TraitsUI buggy view depending on OS

I'm using TraitsUI in Python to create applications, and noticed that the UI disappears on a Mac 10.8, looks great on Ubuntu 10.04, and is somewhere in between for Ubuntu-Mate 14.04 (ie small view discrepancies) This is using the latest version of…
Adam Hughes
  • 14,601
  • 12
  • 83
  • 122