my $slist = Gtk3::SimpleList->new ( 'Text Field' => 'text', 'Markup Field' => 'markup', 'Int Field' => 'int', 'Double Field' => 'double', 'Bool Field' => 'bool', 'Scalar Field' => 'scalar', 'Pixbuf Field' => 'pixbuf', ); #### # just displays the value in a scalar as # Perl would convert it to a string Gtk3::SimpleList->add_column_type( 'a_scalar', type => 'Glib::Scalar', renderer => 'Gtk3::CellRendererText', attr => sub { my ($treecol, $cell, $model, $iter, $col_num) = @_; my $info = $model->get ($iter, $col_num); $cell->set (text => $info); } ); # sums up the values in an array ref and displays # that in a text renderer Gtk3::SimpleList->add_column_type( 'sum_of_array', type => 'Glib::Scalar', renderer => 'Gtk3::CellRendererText', attr => sub { my ($treecol, $cell, $model, $iter, $col_num) = @_; my $sum = 0; my $info = $model->get ($iter, $col_num); foreach (@$info) { $sum += $_; } $cell->set (text => $sum); } );