summaryrefslogtreecommitdiff
path: root/libtk/textw.c
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-23 00:30:12 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-23 00:30:12 +0000
commit6e425a9de8c003b5a733621a6b6730ec3cc902b8 (patch)
tree314123bcab78ff295f38f85f31dc141e5fe22d15 /libtk/textw.c
parent74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (diff)
20061220
Diffstat (limited to 'libtk/textw.c')
-rw-r--r--libtk/textw.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libtk/textw.c b/libtk/textw.c
index bf560d9f..f17c9edb 100644
--- a/libtk/textw.c
+++ b/libtk/textw.c
@@ -113,10 +113,10 @@ static TkEbind tktbinds[] = {
{TkKey|CNTL('p'), "%W tkTextSetCursor {insert-1l}"},
{TkKey|Up, "%W tkTextSetCursor {insert-1l}"},
{TkKey|CNTL('u'), "%W tkTextDelIns -l"},
- {TkKey|CNTL('v'), "%W yview scroll 1 page"},
- {TkKey|Pgdown, "%W yview scroll 1 page"},
+ {TkKey|CNTL('v'), "%W yview scroll 0.75 page"},
+ {TkKey|Pgdown, "%W yview scroll 0.75 page"},
{TkKey|CNTL('w'), "%W tkTextDelIns -w"},
- {TkKey|Pgup, "%W yview scroll -1 page"},
+ {TkKey|Pgup, "%W yview scroll -0.75 page"},
{TkFocusout, "%W tkTextCursor delete"},
{TkKey|APP|'\t', ""},
{TkKey|BackTab, ""},
@@ -1799,8 +1799,9 @@ tktview(Tk *tk, char *arg, char **val, int nl, int *posn, int max, int orient)
}
else
if(strcmp(buf, "scroll") == 0) {
- arg = tkword(tk->env->top, arg, buf, buf+sizeof(buf), nil);
- amount = atoi(buf);
+ e = tkfracword(tk->env->top, &arg, &amount, nil);
+ if(e != nil)
+ return e;
arg = tkskip(arg, " \t");
if(*arg == 'p') /* Pages */
amount *= nl;
@@ -1811,6 +1812,7 @@ tktview(Tk *tk, char *arg, char **val, int nl, int *posn, int max, int orient)
}
else
amount *= tk->env->wzero;
+ amount = TKF2I(amount);
n = *posn + amount;
if(n < 0)
n = 0;