Re: How to...

Search this archive.

From: Jason (jason@jnj.org)
Date: Wed 03 Oct 2001 - 21:11:20 IST


On Wed, Oct 03, 2001 at 01:11:26PM -0500, Cederik De Leon A wrote:
> Dear Listears: :)
> 
> 	I'm writing a little program for Kids for the national science divulgation 
> encounter. My Q: is the next. i have a little screen with fields and some 
> data, in the left-hand TOP corner i have a little clock. How i can make the 
> continuous clock update and at the same time wait for a kbd instruction.
> 

I use alarm() for a similar thing.  just set up a signal handler that catches
SIGALRM, redraws the clock, and calls alarm(1) to update the clock once a
second.  alarm(60) will update it once a minute.

then, at the beginning of the program, just call alarm(60) once and away
you go.  if you ever need to turn off the clock update, just do alarm(0).

pretty simple.

--
Jason


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST