in reply to Re^2: Perl::Gtk and Color tutorial
in thread Perl::Gtk and Color tutorial

take a look at the perl-gtk2 class docs. Label is a subclass of widget, which provides the get_colormap function. In your above code change:
my $colormap = $l->window->get_colormap();
to:
my $colormap = $l->get_colormap();
I have not used this but it looks right from the docs.

Replies are listed 'Best First'.
Re^4: Perl::Gtk and Color tutorial
by Crackers2 (Parson) on Dec 15, 2004 at 15:00 UTC

    That does get me a little further, but now it still fails on the last line:

    my $l = new Gtk::Label( "Success" ); my $colormap = $l->get_colormap(); my $gdk_color = Gtk::Gdk::Color->parse_color( "green" ); $gdk_color = $colormap->color_alloc( $gdk_color ); $l->window->set_background( $gdk_color );

    $l->window is undefined, so can't do a set_background on it, and $l->set_background doesn't appear to exist either.