在Gtk2/Ruby中为按钮添加自定义背景色,使其具有橙色边框
我正在尝试做一些非常基本的UI工作,我需要设置一个特定的颜色作为按钮的背景。我正在使用Gtk2/Ruby,这里有一些示例,我正在使用这些示例了解Windows 10上的问题在Gtk2/Ruby中为按钮添加自定义背景色,使其具有橙色边框,ruby,gtk2,ruby-gnome2,Ruby,Gtk2,Ruby Gnome2,我正在尝试做一些非常基本的UI工作,我需要设置一个特定的颜色作为按钮的背景。我正在使用Gtk2/Ruby,这里有一些示例,我正在使用这些示例了解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
#!/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
这就是结果。查看按钮边框上显示的橙色色调。我认为使用标准绿色没有这个问题
你知道我怎样才能去掉边界上的橙色吗