Re: Display Portions of an Image



-----BEGIN PGP SIGNED MESSAGE-----
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


- -- 
 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?"
 http://openthought.net       | Schroeder: "The joy is in the playing."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/JZ4OR5UKaDAjAG4RAsldAKC1ekMQjLmGNz/CuowUXE/BPIH4AwCgq58b
FGnyQLtdOquLFooGR9a3qUk=
=IqGu
-----END PGP SIGNATURE-----



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