Bug 963571 - pygtk lost colors on buttons
pygtk lost colors on buttons
Product: Fedora
Classification: Fedora
Component: pygtk2 (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: leigh scott
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-05-16 03:34 EDT by Jos de Kloe
Modified: 2015-06-04 09:15 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-05-29 19:08:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
a script to test button coloring (605 bytes, text/x-python)
2013-05-16 03:34 EDT, Jos de Kloe
no flags Details
screenshot of it working (41.20 KB, image/png)
2015-05-29 19:08 EDT, leigh scott
no flags Details
working example (1.05 KB, text/x-python)
2015-06-04 09:14 EDT, Jos de Kloe
no flags Details

  None (edit)
Description Jos de Kloe 2013-05-16 03:34:42 EDT
Created attachment 748629 [details]
a script to test button coloring

Description of problem:

on my current system all colors on gtk buttons are gone for GUI created from python.
On the other hand buttons in GUI created using tkinter from python seem to take their colors as expected, so it doesn't seem to be a problem in my graphics system or drivers.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.run the attached python script
2.hover the mouse over the test button
3.click the quit button to quit

Actual results:
after starting the script both buttons appear with the default gray color
and hovering the mouse over the test button does not change its color

Expected results:
at startup the test button should have a green color, the quit button should have a red color
When moving the mouse over the test button, the color of the button should change from green to red

Additional info:
Comment 1 Jos de Kloe 2013-05-31 04:21:51 EDT
I see the same issue now on another machine running F18.
Software versions here are the same but this one has a recent nvidia proprietary driver installed in stead of the nouveau driver (which was used for the machine mentioned in the above report of 16-May). Not sure if this is relevant, but just for completeness I'll report it anyway.
Comment 2 Jos de Kloe 2013-07-10 16:50:32 EDT
problem persists on Fedora 19 with software versions:
Comment 3 Jos de Kloe 2014-01-02 14:40:37 EST
Still the same issue in Fedora 20 with software versions:

Comment 4 Fedora Admin XMLRPC Client 2014-12-06 10:43:49 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Fedora Admin XMLRPC Client 2014-12-06 12:16:52 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Fedora End Of Life 2015-05-29 05:03:54 EDT
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Jos de Kloe 2015-05-29 18:19:04 EDT
Still the same issue in Fedora 21 with software versions:


if you need any more details to track down this issue please ask.
Comment 8 leigh scott 2015-05-29 19:08:19 EDT
Created attachment 1032296 [details]
screenshot of it working

Works fine here
Comment 9 leigh scott 2015-05-29 19:11:10 EDT
Tested on F22 problem doesn't exist

$ inxi -S
System:    Host: localhost.localdomain Kernel: 4.0.4-301.fc22.x86_64 x86_64 (64 bit)
           Desktop: Cinnamon 2.6.4  Distro: Fedora release 22 (Twenty Two)

$ rpm -q pygtk2 python
Comment 10 Jos de Kloe 2015-05-30 09:45:37 EDT
So it must be a local config issue on my side. Any hints on how to test this?
Comment 11 Jos de Kloe 2015-06-04 09:14:24 EDT
Created attachment 1034715 [details]
working example
Comment 12 Jos de Kloe 2015-06-04 09:15:49 EDT
Just to record this for later readers:

The issue seems related to an api change that I totally overlooked.
On http://pygtk.org/pygtk2reference/class-gtkwidget.html the description of gtk.Widget.modify_bg states in a side note:

"modify_bg() only affects widgets that have an associated gtk.gdk.Window. Widgets that do not have an associated window include ..., gtk.Button, ... These widgets can be added to a gtk.EventBox to overcome this limitation."

Now adding and EventBox actually did not work for me at all, and also others have struggled with this. The correct solution involves modifying the style of the button as illustrated in the attached script.

See also this discussion for this method:

Note You need to log in before you can comment on or make changes to this bug.