Re: Bug in pixbuf->copy ?

On Tue, 2006-04-18 at 11:23 +0200, Jaap Karssenberg wrote:

    use strict; #!!!

    sub insert_image {
       my ($textbuffer, $file) = @_;
       my $pixbuf = Gtk2::Pixbuf->new_from_file($file) if -f $file and -r _;
       $pixbuf ||= Gtk2::Image->new->render_icon('gtk-missing-image', 
       # ...

This is actually an undocumented and not future-proof way of getting
static variables.  The "glitches" that make it work are described in
[1].  There was also an entry about this on of the p5p digests, but the
original site[2] doesn't seem to have it anymore -- probably to not
further publicize the trick.  Anyway, the Google cache[3] still has it.



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