HI
I attempted to set cell-background via an attribute, as opposed to a property
As a property I need to setup a GDK::RGBA object eg: my $rgbaedit1=Gtk3::Gdk::RGBA->new(0,0,0,0.1);
and Then $cell->set (‘cell-background-rgba’,$rgbaedit1)
However if I try an equivalent approach via attribute
eg: lookup column in the model ‘Glib::String’
value in column $rgbaedit1
$col->add_attribute($renderer,‘cell-background-rgba’,), I get unable to set GDKColor from gchararray error
However if I change to
value in column ‘rgba(0,0,0,0.1)’
and $col->add_attribute($renderer,‘cell-background’,) it works (note the missing -rgba suffix to attribute name)
Is this expected behaviour, or is there a different Glib type I should be using for the model
There is no automatic transformation from strings to GdkRGBA values; if you want to do that, you will need to use a custom cell data function. Alternatively, you will need to store the color as a GdkRGBA in the model in the first place.
Is there a difference, performance or otherwise between
model column - Glib::String
Model value - rgba(0…0.0.0.1)
$cell->add_attribute($r,‘cell-background’,$col)
and
my $rgba=Gtk3::Gdk::RGBA;
Model Column - Gtk3::Gdk::RGBA;
Model Value - $rgba
$cell->add_attribute($r,‘cell-attribute-rgba’,$col)
(where $col in both cases is the appropriate column in the liststore and $r is the cell renderer)