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

Can I force my enable Container to redraw from a traitsui Handler?

I have employed a traitsui.api.Handler to catch and handle events for a traitsui.api.View, that view includes a button, whose behavior is to remove a plot from a container containing multiple plots. The container's components list is accessed when…
OYRM
  • 1,395
  • 10
  • 29
1
vote
3 answers

Adding default file directory to FileDialog in Traits

I am using the FileDialog class within TraitsUI, which works pretty well, except for the life of me, I have not been able to figure out how to pass a default directory, for the dialogue to use. Ideally, the dialogue box would open at a point in…
DunkM
  • 11
  • 1
1
vote
1 answer

Changing Fonts, Size , Background Color of Traits in TraitsUI

I am using TraitsUI to make a GUI. I want to be able to edit more about how the GUI actually looks. E.g. I want to be able to change the font of certain Str objects, change the background color of some boxes, make some boxes much larger with larger…
user2175850
  • 193
  • 2
  • 13
1
vote
1 answer

Multi Object View Behaviour - Creating an Editor for a HasTraits subclass

I am currently trying to make a traitsUI GUI for a class that contains many instances of a single object. My problem is very similar to the one solved in MultiObjectView Example TraitsUI. However, I don't like the idea of using a context as it…
user2175850
  • 193
  • 2
  • 13
1
vote
1 answer

Change mlab quiver3d & surf data sources without clearing figure in traits script

I have a Traits and Mayavi script that presents an mlab scene and several traits editors. The editors affect what data is shown in a surface, quiver3d and legend (Scalar LUT Manager) by calling my drawing method. Each change triggers a clear figure…
fearmint
  • 5,276
  • 2
  • 33
  • 45
1
vote
1 answer

TraitsUI CheckListEditor changing the case of values

I am using CheckListEditor to let user choose a subset of available options. With the style set to 'custom', it displays a list of check-list boxes with labels alongside. This is what I wanted. But, one problem is that, the text content is displayed…
Suresh
  • 925
  • 1
  • 9
  • 23
1
vote
1 answer

Inheritance of TraitsUI objects

I am trying to make a Traits gui base class and I have other classes that I want to inherit some items (i.e. groups) from this class. I do not want to completely inherit the view between these classes, just some of the objects. When I try For…
1
vote
0 answers

side effect of importing pdb -- reference to C++ object from traitsui wxpython is retained

I was debugging some code with pdb, and found that the program worked as intended whenever the pdb module was imported (whether or not any breakpoints were active), but crashes otherwise. Specifically, the code is multithreaded standalone GUI…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
1
vote
2 answers

Pop-up warning if directory contains file before selecting it [Python, traitsui]

I'm using enthought traitsui and traits modules to make a simple GUI. The code I have for now is shown bellow. I'm looking for a way to pop-up a warning if the "base directory" of a new Study_info instance contains a file called "conf.txt" before…
1
vote
1 answer

traitsui prevent txt-box from realtime updating

Frequently when using traitsui, i have a depends_on relationships that are somewhat costly, and i would to Not update the trait with every character entry of a text-box. For example, if i have a Int which is used in a calculation, through…
alex
  • 2,968
  • 3
  • 23
  • 25
1
vote
1 answer

enter_set like behavior in TableEditor

I'm building a TableEditor using the wx backend. The table is a list of DatasetElement objects whose panel_name and dataset_name objects are exposed. Additionally, and unrelated to the problem at hand, whatever row is selected additionally…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
1
vote
2 answers

How do you get access to the dictionary under traits.api.Dict()?

Here is an example of failure from a shell. >>> from traits.api import Dict >>> d=Dict() >>> d['Foo']='BAR' Traceback (most recent call last): File "", line 1, in TypeError: 'Dict' object does not support item assignment I have…
user2121874
  • 171
  • 1
  • 8
1
vote
1 answer

enabled_when listening outside model object

I found a workaround to my original problem but I am hoping someone else can explain what is going on. I originally noticed that enabled_when, and I'd imagine visible_when also, appears to take effect in response to trait events originating from the…
aestrivex
  • 5,170
  • 2
  • 27
  • 44
1
vote
1 answer

Python TraitsUI - how to control scrollbar position of a 'String' trait editor/view

I'm using Traits 4 to build a simple interactive GUI application. This application will display a timestamped log of events in a dedicated part of the GUI. This log is currently stored as a String trait. The default editor (or View? Not sure on the…
davidA
  • 12,528
  • 9
  • 64
  • 96
1
vote
1 answer

Why attribute doesn't update in traitsui on user input

I have a simple program that gets an text input from the user, and displays it on an instrument (Keithley). However, the attribute does not seem to change. That is, when I run the Start method, the output is "Wowee", even if I change Display in a…
DanG
  • 306
  • 7
  • 15