Can not retrieve Gdk.RGBA from a Gtk.ListStore in Gtk3
If I store a Gdk.RGBA
object into a Gtk.ListStore
and then retrieve it, red and green components are always zeroed. This is a minimal example to reproduce the issue:
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
list_store = Gtk.ListStore(Gdk.RGBA)
stored = Gdk.RGBA(0.4, 0.5, 0.6, 0.7)
list_store.append([stored])
retrieved = list_store.get_value(list_store.get_iter_first(), 0)
print("stored:", stored)
print("retrieved:", retrieved)
assert stored == retrieved
I get the following output when I run the code above:
stored: Gdk.RGBA(red=0.400000, green=0.500000, blue=0.600000, alpha=0.700000)
retrieved: Gdk.RGBA(red=0.000000, green=0.000000, blue=0.600000, alpha=0.700000)
Traceback (most recent call last):
File "./bug.py", line 17, in <module>
assert stored == retrieved
AssertionError
Edited by Lucas Vella