Reputation: 27
Now I have created a ColorButton, when clicked a color picker pops up and the user can pick a color.
val color_button = Gtk.ColorButton.new()
At that time, I wanted to directly set the background color of the button to the color I specified (such as red). Then, when the button is clicked, it will directly output the value of the background color set by the button, instead of popping up a color picker.
How should I write the code? According to the gtk documentation, the compiler keeps reporting errors.
Upvotes: 0
Views: 31