logo       

Re: Display Portions of an Image: msg#00312

Subject: Re: Display Portions of an Image
Eric Andreychek wrote:

> 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?

No. In case of a timeout, the return value controls whether the timeout
should continue or not. False stops the timeout. The same applies to I/O
watchers.

Also the return value of signal callbacks are important. Returning true
indicates that the signal was handled finally and no other signal 
handlers will be called (only important in case there is more than one 
handler connected to the signal, which is not unusal). If you have 
"strange" behaviour on the GUI, check your return values. They are 
important and you need them! ;)

Regards,

Joern

-- 
Joern Reder
supporting:   http://www.zyn.de/
unbelievable: http://www.exit1.org/
CPAN:         http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED

Attachment: pgpATFHOWzLHd.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe