static char* tkentryb1r(Tk *tk, char* arg, char **ret) { USED(tk); USED(arg); USED(ret); tkcancelrepeat(tk); return nil; }
static char* tkScrolBut1R(Tk *tk, char *arg, char **val) { TkScroll *tks = TKobj(TkScroll, tk); USED(val); USED(arg); tkcancelrepeat(tk); tks->flag &= ~(ActiveA1|ActiveA2|ActiveB1|ButtonA1|ButtonA2|ButtonB1|Autorepeat); tk->dirty = tkrect(tk, 1); return nil; }
static void screpeat(Tk *tk, void *v, int cancelled) { char *e, *pos; int repeat; TkScale *tks = TKobj(TkScale, tk); pos = v; if (cancelled) { tks->flag &= ~Autorepeat; return; } e = stepscale(tk, pos, &repeat); if(e != nil || !repeat) { tks->flag &= ~Autorepeat; tkcancelrepeat(tk); } tk->dirty = tkrect(tk, 1); tkupdate(tk->env->top); }
static void sbrepeat(Tk *tk, void *v, int cancelled) { char *e, buf[Tkmaxitem]; TkScroll *tks = TKobj(TkScroll, tk); char *fmt = (char *)v; if (cancelled) { tks->flag &= ~Autorepeat; return; } if(tks->cmd != nil && fmt != nil) { snprint(buf, sizeof(buf), fmt, tks->cmd); e = tkexec(tk->env->top, buf, nil); if (e != nil) { tks->flag &= ~Autorepeat; tkcancelrepeat(tk); } else tkupdate(tk->env->top); } }
static char* tkscalebut1r(Tk *tk, char *arg, char **val) { TkScale *tks = TKobj(TkScale, tk); char *e, buf[Tkmaxitem], f[32]; USED(val); USED(arg); if(tks->flag & Autorepeat) { tkcancelrepeat(tk); tks->flag &= ~Autorepeat; } e = nil; if (tks->flag & Dragging) { if (tks->command != nil && tks->jump == BoolT && (tks->flag & Dragging)) { tkfprint(f, tks->value); snprint(buf, sizeof(buf), "%s %s", tks->command, f); e = tkexec(tk->env->top, buf, nil); } tks->relief = TKraised; tks->flag &= ~Dragging; tk->dirty = tkrect(tk, 1); } return e; }