Red Hat Bugzilla – Bug 963571
pygtk lost colors on buttons
Last modified: 2015-06-04 09:15:49 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):
Steps to Reproduce:
1.run the attached python script
2.hover the mouse over the test button
3.click the quit button to quit
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
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
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.
problem persists on Fedora 19 with software versions:
Still the same issue in Fedora 20 with software versions:
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
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'
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.
Still the same issue in Fedora 21 with software versions:
if you need any more details to track down this issue please ask.
Created attachment 1032296 [details]
screenshot of it working
Works fine here
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
So it must be a local config issue on my side. Any hints on how to test this?
Created attachment 1034715 [details]
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: