Quite a number of people wrote to me to say that the sample code I’ve given in:
I tested it on both windows and linux. Both worked on my machines.
But after some investigation, I found out that some versions of the php-gtk DO have problem setting the background color.
I’m not sure if it’s a bug or not. But if you find that you have problem setting the background color of a GtkButton using the method outlined above, then try downloading the latest cvs and recompile php-gtk2. Alternatively, if you’re on windows, you could download the php-gtk2 binary from the official php-gtk website: http://gtk.php.net/download.php
You will find that you should be able to set the background color of the GtkButton using these versions.
The place for php-gtk2 sample codes