Re: Multiple cell renderers within one cell



On Tue, 2004-03-30 at 00:01, Brian wrote:

According to the Gtk+2.0 Tree View Tutorial, it's possible to have
multiple cell renderers for a given cell.  However, the author of this
excellant paper stops short of showing actual code to do this.  Anyone
have some code to show using more than one cell-renderer within  a
given cell?

A tree view column is just like a container in that respect:

  my $view_column = Gtk2::TreeViewColumn -> new();

  my $cell_one = Gtk2::CellRenderedText -> new();
  my $cell_two = Gtk2::CellRendererText -> new();

  $view_column -> pack_start($cell_one, TRUE);
  $view_column -> pack_start($cell_two, FALSE);

  $view_column -> set_attributes($cell_one, text => $column_one);
  $view_column -> set_attributes($cell_two, text => $column_two);

HTH,
-Torsten




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