Re: Display Portions of an Image

Hash: SHA1

On Mon, 28 Jul 2003, J?rn Reder wrote:
I suppose your code is inside a callback which doesn't return a value 
(and in fact returns false)? After adding the print() statement your 
callback now returns true. So probably adding a simple "return 1" at the
end of the subroutine could do the trick.

Aha!  That was exactly it.  The function in question is called like so:

 Glib::Timeout->add(2000, sub { $self->_update });

Adding "return 1" to the end of the _update function did fix the problem.

Now, there's something I don't understand -- why does that sub need to return
true?  Wouldn't the code within the sub be run regardless of the return value?
And if so, doesn't that mean the image would be updated independantly of the
the value that sub returns?

Apparently not, but I'm most curious as to how this works :-)

Anyhow, thanks for your help.  Have a good one,

- -- 
 Eric Andreychek              | Lucy: "What happens if you practice the
 Eric Conspiracy Secret Labs  |  piano for 20 years and then end up not
 eric openthought net         |  being rich and famous?"       | Schroeder: "The joy is in the playing."
Version: GnuPG v1.0.7 (GNU/Linux)


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