hires_color(colors[8 * 6 + focus]);
hires_color(colors[9 * 6 + focus]);
draw_widget(struct ctk_widget *w,	    unsigned char x, unsigned char y,	    unsigned char clipy1, unsigned char clipy2,	    unsigned char focus){  unsigned char xpos, ypos, xscroll;  unsigned char i, j;  char c, *text;  unsigned char len;  xpos = x + w->x;  ypos = y + w->y;  hires_color(colors[w->type * 6 + focus]);    switch(w->type) {  case CTK_WIDGET_SEPARATOR:    if(ypos >= clipy1 && ypos < clipy2) {      hires_chlinexy(xpos, ypos, w->w);    }    break;  case CTK_WIDGET_LABEL:    text = w->widget.label.text;    for(i = 0; i < w->widget.label.h; ++i) {      if(ypos >= clipy1 && ypos < clipy2) {	hires_gotoxy(xpos, ypos);	ctk_blueround_cputsn(text, w->w);	if(w->w - (hires_wherex() - xpos) > 0) {	  ctk_blueround_cclear(w->w - (hires_wherex() - xpos));	}      }      ++ypos;      text += w->w;    }    break;  case CTK_WIDGET_BUTTON:    if(ypos >= clipy1 && ypos < clipy2) {      hires_color(colors[7 * 6 + focus]);      hires_gotoxy(xpos, ypos);      ctk_blueround_draw_buttonleft();      hires_color(colors[w->type * 6 + focus]);      hires_gotoxy(xpos + 1, ypos);      ctk_blueround_cputsn(w->widget.button.text, w->w);      hires_color(colors[8 * 6 + focus]);            ctk_blueround_draw_buttonright();    }    break;  case CTK_WIDGET_HYPERLINK:    if(ypos >= clipy1 && ypos < clipy2) {      hires_underline(1);      hires_gotoxy(xpos, ypos);      ctk_blueround_cputsn(w->widget.button.text, w->w);      hires_underline(0);    }    break;  case CTK_WIDGET_TEXTENTRY:    text = w->widget.textentry.text;    if(focus & CTK_FOCUS_WIDGET &&       w->widget.textentry.state != CTK_TEXTENTRY_EDIT) {      hires_revers(1);    } else {      hires_revers(0);    }    xscroll = 0;    if(w->widget.textentry.xpos >= w->w - 1) {      xscroll = w->widget.textentry.xpos - w->w + 1;    }    for(j = 0; j < w->widget.textentry.h; ++j) {      if(ypos >= clipy1 && ypos < clipy2) {	if(w->widget.textentry.state == CTK_TEXTENTRY_EDIT &&	   w->widget.textentry.ypos == j) {	  hires_revers(0);	  hires_cputcxy(xpos, ypos, '>');	  for(i = 0; i < w->w; ++i) {	    c = text[i + xscroll];	    if(i == w->widget.textentry.xpos - xscroll) {	      hires_revers(1);	    } else {	      hires_revers(0);	    }	    if(c == 0) {	      ctk_blueround_cputc(' ');	    } else {	      ctk_blueround_cputc(c);	    }	    hires_revers(0);	  }	  ctk_blueround_cputc('<');	} else {	  hires_cputcxy(xpos, ypos, '|');	  /*	  hires_gotoxy(xpos + 1, ypos);          */	  ctk_blueround_cputsn(text, w->w);	  i = hires_wherex();	  if(i - xpos - 1 < w->w) {	    ctk_blueround_cclear(w->w - (i - xpos) + 1);	  }	  ctk_blueround_cputc('|');	}      }      ++ypos;      text += w->widget.textentry.len;    }    hires_revers(0);    break;  case CTK_WIDGET_ICON:    if(ypos >= clipy1 && ypos < clipy2) {      hires_gotoxy(xpos, ypos);      if(w->widget.icon.bitmap != NULL) {	draw_bitmap_icon(w->widget.icon.bitmap);      }      x = xpos;      len = strlen(w->widget.icon.title);      if(x + len >= SCREEN_WIDTH) {	x = SCREEN_WIDTH - len;      }            hires_gotoxy(x, ypos + 3);      ctk_blueround_cputsn(w->widget.icon.title, len);    }    break;  default:    break;  }}