Cellrenderercombo show multiple columns (clarification)

Hi
After some faffing around I have got the following to work
cellrenderercombo to show multiple columns
the text-column being 1 (ie:the second column)
Columns showing “headings” (via non-sensitive first row)

This works but seems way too complex.

  1. Setup liststore for cellrenderer with columns for cell values plus sensitivity and background colour)

  2. set text-column to 1

  3. Then in editing-started signal of cell renderer

a) Add columns to “treeview” of combobox of renderer for each column required (three in this case) with a cellrenderertext
b) Set original cell renderer visible property to no
c) add header info to first row
d) set appropriate attributes for background colour and sensitivity

If I just add the extra columns or have visibility set to true, the first column shows text-column value.

eg: (all for editing-started)
($combo is the associated cellrenderer ie: combobox)
my $modelr=$combo->get_model);
$modelr->clear;
foreach my $ci (0 …2){
my $cell=Gtk3::CellRendererText->new;
$combo->pack_start($cell,1);
$combo->add_attribute($cell,‘text’,$ci);
$combo->add_attribute($cell,‘sensitive’,3);
}

my @cells=$combo->get_cells;

    foreach my $ci (@cells){
						     $combo->add_attribute($ci,'sensitive',3);

$combo->add_attribute($ci,‘cell-background’,4);
}
$modelr->insert_with_values(-1,0=>‘Re Name’,1=>‘Re Search’,2=>‘Re Replace’,3=>0,4=>$rgbaedit0);

Then I add the actual values I want;

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.