2

When opening a traitsui window the background of the window is dark instead of light (see attached screenshot). I just tried a minimal example:

from traits.api import HasTraits, Str, Float, Range

class Reservoir(HasTraits):
    name = Str
    max_storage = Float(1e6, desc='Maximal storage [hm3]')
    max_release = Float(10, desc='Maximal release [m3/s]')
    head = Float(10, desc='Hydraulic head [m]')
    efficiency = Range(0, 1.)

    def energy_production(self, release):
        ''' Returns the energy production [Wh] for the given release [m3/s]
        '''
        power = 1000 * 9.81 * self.head * release * self.efficiency
        return power * 3600

res = Reservoir()
res.configure_traits()

Screenshot of what I mean

I'm running Ubuntu 16.04 and pylab with the qt4 backend. Is there some way to change the background colour to somehting lighter?

C. Lab
  • 21
  • 2
  • Is this not caused by the OS you're running on? If you're on Gnome, for instance, in the dark theme, you'd see this... If so, the correct way to work with this is not to change the colour of the window, but to adjust the colour of your text based on the background colour of the window. In that case, I've still no idea what the answer is, but it's better practice to _with_ what you've got, instead of trying to change the world to work with you. It strikes me that in fact this is a bug with traits, where it is picking up some system settings (window background) but not others (font colour). – XtrmJosh May 24 '16 at 09:37
  • I don't know. Even with Radiance (a very light desktop theme) everything becomes light (toolbars, window titles etc), but the background of a traits window. GTK and Qt windows look fine btw. – C. Lab May 24 '16 at 10:28

0 Answers0