1

I'm trying to do some really basic UI stuff where I need to set a specific color as a background of a button. I'm working with Gtk2/Ruby and here some sample using which I'm seeing the issue on Windows 10.

#!/usr/bin/env ruby

require 'gtk2'

# Creates the main window.
@window = Gtk::Window.new

# You should always remember to connect the delete_event signal
# to the main window. This is very important for proper intuitive
# behavior.
@window.signal_connect("delete_event") do
  Gtk::main_quit
  false
end
@window.border_width = 10

# Create a button
@button = Gtk::Button.new("Test")

# Set the colors to test
@button.modify_bg(Gtk::STATE_NORMAL, Gdk::Color.parse("#049678"))
@button.modify_bg(Gtk::STATE_PRELIGHT, Gdk::Color.parse("blue"))
@button.modify_bg(Gtk::STATE_ACTIVE, Gdk::Color.parse("yellow"))

@window.add(@button)

# Display all widgets.
@window.show_all

# As usual, we finish by entering the main loop, with Gtk.main.
Gtk.main

And this is the result. See the orange tinge that appears at the borders of the button. I figured that using the standard green color does not have this problem.

enter image description here

Any idea how I can get rid of the orange color on the border?

Rahul Vijay Dawda
  • 1,123
  • 3
  • 14
  • 36

0 Answers0