Comment 15 for bug 1975947

Revision history for this message
Paul Loewenstein (paullionstone) wrote : Re: pronterface does not start in jammy

Trying to get the current release of Pronterface to work.

This issue I found using wxpython 4.0.7 (as supplied by Ubuntu) is that the pronterface button-handling code uses the wx.Colour GetLuminance attribute, which is supplied only in wxpython 4.1.0 and later.

I tried user-installing later versions of wxpython, but 4.1.0 wouldn't compile, and 4.1.1, 4.2.0 and 4.2.1 all resulted in pronterface displaying a black rectangle in place of the build surface.

So for the moment I have modified pronterface.py (in the package, not the top level).

if b.GetBackgroundColour().GetLuminance() < 0.5:
    b.SetForegroundColour("#ffffff")

is changed to:

try:
    if b.GetBackgroundColour().GetLuminance() < 0.5:
        b.SetForegroundColour("#ffffff")
except AttributeError:
    cxx = b.GetBackgroundColour().GetRGB ()
    lxx = 0.299 * (cxx & 255) + 0.587 * ((cxx >> 8) & 255) + 0.114 * (cxx >> 16)
    if lxx < 127.5:
        b.SetForegroundColour("#ffffff")

For the moment, this is the only way I can get Pronterface to work. This is not a distributable fix; we need to work out why later versions of wxpython don't work properly.