URI:
       Press 'b' to switch box on/off - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
  HTML git clone https://git.drkhsh.at/tty-clock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 8502f635db47715ae3f1c157debffbc3dc363b12
   DIR parent 3594e6276b54f4508e969ec7b4a9c723ce6a2bde
  HTML Author: BenoƮt Zugmeyer <bzugmeyer@gmail.com>
       Date:   Wed,  5 May 2010 15:55:34 +0200
       
       Press 'b' to switch box on/off
       
       Diffstat:
         M ttyclock.c                          |      35 +++++++++++++++++++++++++++++--
         M ttyclock.h                          |       1 +
       
       2 files changed, 34 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -258,8 +258,10 @@ clock_move(int x, int y, int w, int h)
                   ttyclock->geo.y + (ttyclock->geo.w / 2) - (strlen(ttyclock->date.datestr) / 2) - 1);
             wresize(ttyclock->datewin, DATEWINH, strlen(ttyclock->date.datestr) + 2);
        
       -     box(ttyclock->framewin, 0, 0);
       -     box(ttyclock->datewin,  0, 0);
       +     if(ttyclock->option.box) {
       +           box(ttyclock->framewin, 0, 0);
       +           box(ttyclock->datewin,  0, 0);
       +     }
        
             wrefresh(ttyclock->datewin);
             wrefresh(ttyclock->framewin);
       @@ -323,6 +325,29 @@ set_center(Bool b)
        }
        
        void
       +set_box(Bool b)
       +{
       +     ttyclock->option.box = b;
       +
       +     wbkgdset(ttyclock->framewin, COLOR_PAIR(0));
       +     wbkgdset(ttyclock->datewin, COLOR_PAIR(0));
       +
       +     if(ttyclock->option.box) {
       +         wbkgdset(ttyclock->framewin, COLOR_PAIR(0));
       +         wbkgdset(ttyclock->datewin, COLOR_PAIR(0));
       +         box(ttyclock->framewin, 0, 0);
       +         box(ttyclock->datewin,  0, 0);
       +     }
       +     else {
       +         wborder(ttyclock->framewin, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
       +         wborder(ttyclock->datewin, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
       +     }
       +
       +     wrefresh(ttyclock->datewin);
       +     wrefresh(ttyclock->framewin);
       +}
       +
       +void
        key_event(void)
        {
             int i, c;
       @@ -392,6 +417,12 @@ key_event(void)
                  if(ttyclock->option.rebound && ttyclock->option.center)
                       ttyclock->option.center = False;
                  break;
       +
       +     case 'b':
       +     case 'B':
       +          set_box(!ttyclock->option.box);
       +          break;
       +
             default:
                  nanosleep(&length, NULL);
                  for(i = 0; i < 8; ++i)
   DIR diff --git a/ttyclock.h b/ttyclock.h
       @@ -107,6 +107,7 @@ void draw_clock(void);
        void clock_move(int x, int y, int w, int h);
        void set_second(void);
        void set_center(Bool b);
       +void set_box(Bool b);
        void key_event(void);
        
        /* Global variable */