Gkt2::CellRendererScalar ??



how useful do you think it would be to have a CellRenderer that draws perl
scalars?

  $model = Gtk2::ListStore->new ('Glib::Scalar');
  $treeview = Gtk2::TreeView->new ($model);
  $renderer = Gtk2::CellRendererScalar->new;
  $column = Gtk2::TreeViewColumn->new_with_attributes ('a perl var',
                                            $renderer, source => 0);

would basically do the optimized version of

  $model = Gtk2::ListStore->new ('Glib::Scalar');
  $treeview = Gtk2::TreeView->new ($model);
  $renderer = Gtk2::CellRendererText->new;
  $treeview->insert_column_with_data_func (-1, 'a perl var', $renderer,
                             sub { $_[2]->get ($_[3], 0) });


overkill?  unnecessary?  fancy?  can't live without it?  what do you think?

-- 
muppet <scott at asofyet dot org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]