enthought / traitsui

TraitsUI: Traits-capable windowing framework
http://docs.enthought.com/traitsui
Other
297 stars 95 forks source link

WX > 2.8.10 bugs, but QT incomplete behavior. #192

Open hughesadam87 opened 9 years ago

hughesadam87 commented 9 years ago

Hi,

@jdmarch (CCing you as followup to the Stack Overflow thread a few weeks ago)

We're using a fairly complex TraitsUI (4.4.0) GUI and have found that in versions of WX 2.8.12 and higher, including WX 3.X, the view does not render correctly. Some screenshots and my initial post of this issue on stack:

http://stackoverflow.com/questions/27790572/traitsui-buggy-view-depending-on-os

We've confirmed it works on wx 2.8.10 from my old laptop that had that version by default. Unfortunately, it's very difficult to build WX 2.10 on ubuntu now, especially in a virtual env. All the old solutions I've found so far have failed, and even symbolic linking my system python isn't helpful because apt-get install now installs 2.8.12.

Setting the backend to QT works, but it has several issues (I'm using pyqt=4.10.4). First, we have lists shown in a Table Editor which show no default selected item, even though the program initiates with a selection. In addition, table items are not being sorted correctly. The ValueEditor colors are much nicer in wx than in qt (I can provide screenshot if helpful), etc... We've confirmed that all of the issues are resolved when we switch to wx2.8.10 on my laptop.

Therefore, my program as-is has view bugs and looks sloppier in QT than in wx 2.10, but in other versions of wx, it renders awfully as show in link above. These bugs will lead users to inevitable mistakes, for example thinking no entry is selected in a table, when it actually is and it's just not showing up on the initial view and so forth. Here are all my packages:

apptools                  4.2.1                    py27_0  
cairo                     1.12.18                       0  
chaco                     4.4.1                np19py27_0  
configobj                 5.0.6                    py27_0  
dateutil                  2.1                      py27_2  
enable                    4.3.0                np19py27_2  
envisage                  4.4.0                    py27_1  
freetype                  2.4.10                        0  
jinja2                    2.7.3                    py27_1  
jpeg                      8d                            0  
jsonschema                2.4.0                    py27_0  
lcms                      1.19                          0  
libpng                    1.5.13                        1  
libsodium                 0.4.5                         0  
markupsafe                0.23                     py27_0  
matplotlib                1.4.2                np19py27_0  
mayavi                    4.3.1                np19py27_1  
numpy                     1.9.1                    py27_0  
openssl                   1.0.1k                        0  
pandas                    0.14.1               np19py27_0  
pil                       1.1.7                    py27_1  
pixman                    0.26.2                        0  
py2cairo                  1.10.0                   py27_2  
pyface                    4.4.0                    py27_0  
pyparsing                 2.0.1                    py27_0  
pyqt                      4.10.4                   py27_0  
python                    2.7.9                         1  
pytz                      2014.9                   py27_0  
pyyaml                    3.11                     py27_0  
pyzmq                     14.4.1                   py27_0  
qt                        4.8.5                         0  
readline                  6.2                           2  
scipy                     0.14.0               np19py27_0  
setuptools                11.3.1                   py27_0  
sip                       4.15.5                   py27_0  
six                       1.9.0                    py27_0  
sqlite                    3.8.4.1                       0  
ssl_match_hostname        3.4.0.2                  py27_0  
system                    5.8                           1  
tk                        8.5.15                        0  
tornado                   4.0.2                    py27_0  
traits                    4.4.0                    py27_0  
traitsui                  4.4.0                    py27_0  
vtk                       5.10.1                   py27_1  
yaml                      0.1.4                         0  
zeromq                    4.0.4                         0  
zlib                      1.2.8                         0 
hughesadam87 commented 9 years ago

Just wanted to update that wxPython < 2.8.12 cannot be installed on OS with python 2.7 or higher, so it's actually impossible to use 2.8.10 unless you're on an old OS like Ubuntu 10.04.

hughesadam87 commented 9 years ago

@corranwebster @rkern

Robert, Corran,

Wanted to CC you on this issue as I figured you two might have already encountered the buggy WX > 2.8 views in certain traitsui applications (http://stackoverflow.com/questions/27790572/traitsui-buggy-view-depending-on-os). Has either of you encountered such blacking-out in a wx-backed TraitsUI app in the past? It doesn't happen for all traitsui programs, but my farily complex simulation program does exhibit this. I haven't been able to find a way to reproduce it in smaller examples yet.

corranwebster commented 9 years ago

I vaguely remember seeing something like that under Wx on Ubuntu 4 or 5 years ago now, but it was second-hand: it was another developer at Enthought who was experiencing the problem. My recollection was that it was related to TraitsUI (or Enable, or similar) getting the wrong background color from Wx. I thought it had been fixed, but it is possible that the fix was a work-around of a bug in Wx which has now been resolved and the work-around is now a problem.

The other possibility is that we have run into problems with TraitsUI and Wx when dealing with complex and deeply nested UI layouts: TraitsUI can end up generating a lot of panels within panels to the point where Wx itself starts having difficulties and eventually the innermost UI components can start behaving strangely. If I had a suggestion to help you replicate this it would be to create Groups within Groups within Groups until something weird happens.

You may find that simply adjusting your UI design to be less complex resolves at least some of the issues.

We're mainly using Qt these days so if I had an over-all suggestion it would be to use the Qt backend, and work on fixing the issues there: the issues with the TableEditor are likely simply that the Qt backend's implementation is only partial compared to the Wx implementation, but since that's a known issue it's easy to diagnose (if not entirely trivial to fix :) ) compared to delving into the depths of the interactions between Wx and TraitsUI, particularly with hard-to-replicate bugs.

hughesadam87 commented 9 years ago

Thanks Corran. If you remember anything else about the problem, please let me know. I can tell you that it's happening on Mac and Ubuntu now, and only goes away when using wx < 2.8 (which is very hard to install on modern Ubuntu dists.)

We'd be fine with QT, except there are a number of differences where WX just looks better. Here are what we observed in our program:

  1. Wx ValueEditor is nicely clolored, looks pretty ugly in QT.
  2. Tables in QT are not ordered by the order of items in the underlying list; rather, seem to sort based on the attribute in the first column of the table. EG, a table with first column "name" will sort the objects in the table by their name attribute. We'll probably workaround this by changing the name attribute to something like "Index_name", or just "index".
  3. The VSplit/HSplit in wx have nice, yellow triangles that don't appear in QT. Additionally, QT splitting is uneven, so two plots that each occupy 50% of the app width in WX are disproportionate in the QT view.
  4. HTML traits render differently in wx/qt.

At this point, considering how deep the WX issues may be, these don't seem like as much of a problem as I had initially thought.

PS, how's the family life treating you?