9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] mickey clock
@ 2007-12-21 17:47 erik quanstrom
  2007-12-24  4:26 ` John DeGood
  0 siblings, 1 reply; 3+ messages in thread
From: erik quanstrom @ 2007-12-21 17:47 UTC (permalink / raw)
  To: 9fans

mclock really is the bomb.  it's become pretty popular at coraid.
someone noticed if mclock is unhiden, it doesn't redraw.  i believe
this patch corrects the problem.

- erik

; diff -c mclock.c `{yesterday mclock.c}
mclock.c:190,195 - /n/dump/2007/1221/sys/src/games/mclock/mclock.c:190,198
  	newtime = time(0);
  	tm = *localtime(newtime);
  
+ 	if(tm.min == m && eqrect(screen->r, r))
+ 		return;
+ 
  	anghr = (tm.hour*5+(tm.min+6)/12)*6;
  	angmin = tm.min*6;
  	m = tm.min;
mclock.c:275,281 - /n/dump/2007/1221/sys/src/games/mclock/mclock.c:278,284
  	char *mstr[] = {"exit", 0};
  	int key, timer;
  
- 	initdraw(0, 0,"mclock");
+ 	initdraw(0,0,"clock");
  	back = allocimagemix(display, DPalebluegreen, DWhite);
  
  	dots = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DBlue);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] mickey clock
  2007-12-21 17:47 [9fans] mickey clock erik quanstrom
@ 2007-12-24  4:26 ` John DeGood
  2008-01-05  2:30   ` david bulkow
  0 siblings, 1 reply; 3+ messages in thread
From: John DeGood @ 2007-12-24  4:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

All mclock users, please update to new (hopefully final) version:

  http://degood.org/plan9/mclock.tar

Changes:
- new improved mouth, added tongue
- moved update optimization from redraw() to event loop
- fixed typo in window label

Thanks to Erik for discovering the bugs.

John

erik quanstrom wrote:
> mclock really is the bomb.  it's become pretty popular at coraid.
> someone noticed if mclock is unhiden, it doesn't redraw.  i believe
> this patch corrects the problem.
>
> - erik
>
> ; diff -c mclock.c `{yesterday mclock.c}
> mclock.c:190,195 - /n/dump/2007/1221/sys/src/games/mclock/mclock.c:190,198
>   	newtime = time(0);
>   	tm = *localtime(newtime);
>   
> + 	if(tm.min == m && eqrect(screen->r, r))
> + 		return;
> + 
>   	anghr = (tm.hour*5+(tm.min+6)/12)*6;
>   	angmin = tm.min*6;
>   	m = tm.min;
> mclock.c:275,281 - /n/dump/2007/1221/sys/src/games/mclock/mclock.c:278,284
>   	char *mstr[] = {"exit", 0};
>   	int key, timer;
>   
> - 	initdraw(0, 0,"mclock");
> + 	initdraw(0,0,"clock");
>   	back = allocimagemix(display, DPalebluegreen, DWhite);
>   
>   	dots = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DBlue);
>
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] mickey clock
  2007-12-24  4:26 ` John DeGood
@ 2008-01-05  2:30   ` david bulkow
  0 siblings, 0 replies; 3+ messages in thread
From: david bulkow @ 2008-01-05  2:30 UTC (permalink / raw)
  To: nu3e, Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

John,

I cooked up a mkfile for use with p9p.  Thank you for the new clock!

-dbul-

On Dec 23, 2007 11:26 PM, John DeGood <john@degood.org> wrote:
> All mclock users, please update to new (hopefully final) version:
>
>   http://degood.org/plan9/mclock.tar
>
> Changes:
> - new improved mouth, added tongue
> - moved update optimization from redraw() to event loop
> - fixed typo in window label
>
> Thanks to Erik for discovering the bugs.
>
> John
>
> erik quanstrom wrote:
> > mclock really is the bomb.  it's become pretty popular at coraid.
> > someone noticed if mclock is unhiden, it doesn't redraw.  i believe
> > this patch corrects the problem.
> >
> > - erik
> >
> > ; diff -c mclock.c `{yesterday mclock.c}
> > mclock.c:190,195 - /n/dump/2007/1221/sys/src/games/mclock/mclock.c:190,198
> >       newtime = time(0);
> >       tm = *localtime(newtime);
> >
> > +     if(tm.min == m && eqrect(screen->r, r))
> > +             return;
> > +
> >       anghr = (tm.hour*5+(tm.min+6)/12)*6;
> >       angmin = tm.min*6;
> >       m = tm.min;
> > mclock.c:275,281 - /n/dump/2007/1221/sys/src/games/mclock/mclock.c:278,284
> >       char *mstr[] = {"exit", 0};
> >       int key, timer;
> >
> > -     initdraw(0, 0,"mclock");
> > +     initdraw(0,0,"clock");
> >       back = allocimagemix(display, DPalebluegreen, DWhite);
> >
> >       dots = allocimage(display, Rect(0,0,1,1), CMAP8, 1, DBlue);
> >
> >
>
>

[-- Attachment #2: mkfile --]
[-- Type: application/octet-stream, Size: 71 bytes --]

<$PLAN9/src/mkhdr

TARG=mclock

OFILES=\
	mclock.$O

<$PLAN9/src/mkone

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-05  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-21 17:47 [9fans] mickey clock erik quanstrom
2007-12-24  4:26 ` John DeGood
2008-01-05  2:30   ` david bulkow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).