I have played with muppet's cellrenderprogress custom renderer. When I go to display the combo list, I get these messages, the list still gets rendered but performance on this thing is pretty poor. I've attached the program if anyone wants to see it. My question is why isn't the GtkCellView type recognized? Thanks Brian GType 'GtkCellView' is not registered with GPerl; representing this object as first known parent type 'GtkWidget' instead at cellrenderer_combo.pl line 202. GType 'GtkCellView' is not registered with GPerl; representing this object as first known parent type 'GtkWidget' instead at cellrenderer_combo.pl line 204. GType 'GtkCellView' is not registered with GPerl; representing this object as first known parent type 'GtkWidget' instead at cellrenderer_combo.pl line 204. GType 'GtkCellView' is not registered with GPerl; representing this object as first known parent type 'GtkWidget' instead at cellrenderer_combo.pl line 204. GType 'GtkCellView' is not registered with GPerl; representing this object as first known parent type 'GtkWidget' instead at cellrenderer_combo.pl line 204. # ported from Tim-Philipp Meuller's Tree View tutorial, # http://scentric.net/tutorial/sec-custom-cell-renderers.html#sec-custom-cell-renderer-example-body # by muppet, 6 feb 04. # # This is based mainly on GtkCellRendererProgress # in GAIM, written and (c) 2002 by Sean Egan # (Licensed under the GPL), which in turn is # based on Gtk's GtkCellRenderer[Text|Toggle|Pixbuf] # implementation by Jonathan Blandford */ package Mup::CellRendererProgress; use strict; use warnings; use Glib qw(G_PARAM_READWRITE); use Gtk2; use Glib::Object::Subclass Gtk2::CellRenderer::, properties => [ Glib::ParamSpec->double ('percentage', 'Percentage', 'The fractional progress to display', 0.0, 1.0, 0.0, G_PARAM_READWRITE), ], ; sub INIT_INSTANCE { my $self = shift; $self->set (mode => 'inert', xpad => 0, ypad => 0); $self->{percentage} = 0.0; } # we'll use the default new, GET_PROPERTY and SET_PROPERTY provided by # Glib::Object::Subclass. # # calculate the size of our cell, taking into account padding and # alignment properties of parent. # use constant FIXED_WIDTH => 100; use constant FIXED_HEIGHT => 10; use constant RED => Gtk2::Gdk::Color->new(0xFFFF,0x0,0x0); use constant GREEN => Gtk2::Gdk::Color->new(0x0,0xFFFF,0x0); sub MAX { $_[0] > $_[1] ? $_[0] : $_[1] } sub GET_SIZE { my ($cell, $widget, $cell_area) = @_; my ($x_offset, $y_offset) = (0, 0); my $width = int ($cell->get ('xpad') * 2 + FIXED_WIDTH); my $height = int ($cell->get ('ypad') * 2 + FIXED_HEIGHT); if ($cell_area) { $width = int ($cell->get ('xpad') * 2 + $cell_area->width); $height = int ($cell->get ('ypad') * 2 + $cell_area->height); $x_offset = $cell->get ('xalign') * ($cell_area->width - $width); $x_offset = MAX ($x_offset, 0); $y_offset = $cell->get ('yalign') * ($cell_area->height - $height); $y_offset = MAX ($y_offset, 0); } return ($x_offset, $y_offset, $width, $height); } sub RENDER { my ($cell, $window, $widget, $background_area, $cell_area, $expose_area, $flags) = @_; my $defcolor = $widget->style->base('selected'); my ($x_offset, $y_offset, $width, $height) = $cell->GET_SIZE ($widget, $cell_area); my $state = $widget->has_focus ? 'active' : 'normal'; my ($xpad, $ypad) = $cell->get (qw(xpad ypad)); $width -= $xpad*2; $height -= $ypad*2; my $plainstyle = $widget->get_modifier_style->copy; $cell->set('cell_background_set' => 'grey'); $widget->style->paint_box ($window, $state, 'out', undef, $widget, "flatbar", $background_area->x, $background_area->y , $background_area->width, $background_area->height); $widget->style->paint_box ($window, 'normal', 'in', undef, $widget, "trough", $cell_area->x + $x_offset + $xpad, $cell_area->y + $y_offset + $ypad, $width-1, $height-1 ); $widget->modify_bg($state, RED); $widget->style->paint_box ($window, $state, 'out', undef, $widget, "bar", $cell_area->x + $x_offset + $xpad, $cell_area->y + $y_offset + $ypad, $width * $cell->{percentage}, $height-1); $widget->modify_style($plainstyle); } package main; use strict; use Glib qw(TRUE FALSE); use Gtk2 -init; my $liststore; my @increasing = (TRUE,TRUE,FALSE,TRUE); # direction of progress bar change use constant { COL_PERCENTAGE => 0, COL_TEXT => 1, NUM_COLS => 2, STEP => 0.01, }; sub increase_progress_timeout { my $renderer = shift; my $iter = $liststore->get_iter_first; # first and only row my $idx=0; while (defined($iter)) { my $perc = $liststore->get ($iter, COL_PERCENTAGE); if ($perc > (1.0 - STEP) || ($perc < STEP && $perc > 0.0) ) { $increasing[$idx] = (!$increasing[$idx]); } if ($increasing[$idx]) { $perc += STEP; } else { $perc -= STEP; } my $buf = sprintf '%u %%', $perc*100; $liststore->set ($iter, COL_PERCENTAGE, $perc, COL_TEXT, $buf); $iter = $liststore->iter_next($iter); ++$idx; } return TRUE; # Call again } sub create_view_and_model { $liststore = Gtk2::ListStore->new (qw(Glib::Double Glib::String)); $liststore->set ($liststore->append, COL_PERCENTAGE, 0.5); # start at 50% $liststore->set ($liststore->append, COL_PERCENTAGE, 0.2); # start at 20% $liststore->set ($liststore->append, COL_PERCENTAGE, 0.75); # start at 75% $liststore->set ($liststore->append, COL_PERCENTAGE, 1.0); # start at 100% my $view = Gtk2::ComboBox->new($liststore); my $renderer = Gtk2::CellRendererText->new; my $view_alloc = $view->allocation; $view->pack_start ($renderer, TRUE); $view->add_attribute($renderer, text => COL_TEXT); $renderer = Mup::CellRendererProgress->new; $view->pack_start ($renderer, TRUE); $view->add_attribute ($renderer, percentage => COL_PERCENTAGE); $renderer->set_property(cell_background_set => 'grey'); Glib::Timeout->add (50, \&increase_progress_timeout,$view); return $view; } my $window = Gtk2::Window->new; $window->set_default_size (150, 100); $window->signal_connect (delete_event => sub {Gtk2->main_quit}); my $view = create_view_and_model(); $window->add ($view); $window->show_all; Gtk2->main; _______________________________________________ gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list