GTK4 - ColorChooserDialog - "set_rgba" Does Not Work
Steps to reproduce
- Run the example code.
- Click on the button.
- See the colorchooserdialog and the selected color.
Current behavior
set_rgba
does not work for GTK4 colorchooserdialog.
It works for GTK3.
Expected outcome
Selecting a color when colorchooserdialog is shown.
Version information
GTK 4.8.2
Debian 11.5 based distribution (Flatpak application). Also RPM based distribution (default GTK4).
I did not built the GTK.
Additional information
Simple example:
import gi
gi.require_version('Gtk', '4.0')
gi.require_version('Gdk', '4.0')
from gi.repository import Gtk, Gdk
def on_activate(app):
win = Gtk.ApplicationWindow(application=app)
win.set_default_size(100, 100)
button = Gtk.Button()
button.set_label("Color")
button.set_halign(Gtk.Align.CENTER)
button.set_valign(Gtk.Align.CENTER)
button.connect("clicked", on_button_clicked)
win.set_child(button)
global csd
csd = Gtk.ColorChooserDialog().new(title="Color", parent=win)
csd.connect("response", on_csd_response)
win.present()
def on_button_clicked(widget):
color = Gdk.RGBA(0.5, 0.5, 0.5, 1.0)
csd.set_rgba(color)
csd.present()
def on_csd_response(widget, response):
csd.hide()
app = Gtk.Application()
app.connect('activate', on_activate)
app.run(None)