Example #1
0
static void expose_scroll_box(Window w, SCROLLBOX sb) {
  int i;
  /*int flag=-1;*/
  for (i = 0; i < sb.nw; i++)
    if (w == sb.w[i]) {
      redraw_scroll_box(sb);
      return;
    }
  if (sb.nw < sb.nent && w == sb.slide)
    redraw_scroll_box(sb);
}
Example #2
0
scroll_box_motion(XEvent ev,SCROLLBOX *sb)
{
  int x;
  Window w;
  int pos,len;
  w=ev.xmotion.window;
  x=ev.xmotion.y;
  if(sb->nw>=sb->nent)return 0;
  if(w==sb->slide){
    len=sb->len;
    if(x<2)x=2;
    if(x>(len+2))x=len+2;
    pos=((x-2)*(sb->nent-sb->nw))/len;
   if(pos<0)pos=0;
   if(pos>(sb->nent-sb->nw))pos=sb->nent-sb->nw;
   sb->i0=pos;
   redraw_scroll_box(*sb);
  }
}