From 6257024afa02f4a61f05ebd05f9b067974b60f4a Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 3 Apr 2009 13:18:03 +0000 Subject: 20090403-1415 --- CHANGES | 1 + appl/wm/brutus.b | 36 +++++++++++++++++++++++++++--------- dis/wm/brutus.dis | Bin 42584 -> 43081 bytes lib9/getuser-Nt.c | 5 ++--- man/9/text | 2 +- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 659d1885..44308ec7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 20090403 change ,2 to ,#function in Solaris sparc assembler files (apparently works in gcc and sun's) + make appl/wm/brutus.b pass input to its widgets (issue 105) 20090402 add missing emu/Linux/segflush-*.c files and remove ARM segflush from os.c 20090402 diff --git a/appl/wm/brutus.b b/appl/wm/brutus.b index b18d6a9d..0d177bf8 100644 --- a/appl/wm/brutus.b +++ b/appl/wm/brutus.b @@ -1718,7 +1718,7 @@ widget(parent: ref Tk->Toplevel, ctxt: ref Draw->Context, cfg: array of string): tkcmds(top: ref Tk->Toplevel, a: array of string) { for(i := 0; i < len a; i++) - v := tk->cmd(top, a[i]); + v := tkcmd(top, a[i]); } confirm(ctxt: ref Draw->Context, parent: ref Tk->Toplevel, message: string, write: int): string @@ -1735,8 +1735,17 @@ confirm1(ctxt: ref Draw->Context, parent: ref Tk->Toplevel, message: string, wri if(write == 0) tkcmd(t, "destroy .f.exitclean"); tkcmd(t, UPDATE); + tkclient->onscreen(t, "onscreen"); cmd := chan of string; tk->namechan(t, cmd, "cmd"); + tkclient->onscreen(t, "exact"); + tkclient->startinput(t, "ptr"::nil); + for(;;) alt { + s := <-t.ctxt.ptr => + tk->pointer(t, *s); + c := <-cmd => + return c; + } return <-cmd; } @@ -1843,17 +1852,26 @@ tageditor(ctxt: ref Draw->Context, f: ref File) t := widget(f.tk, ctxt, cfg[0:i]); cmd := chan of string; tk->namechan(t, cmd, "cmd"); + tkclient->onscreen(t, "exact"); + tkclient->startinput(t, "kbd"::"ptr"::nil); loop: for(;;){ - case c := <-cmd { - "ok" => - break loop; - "cancel" => - return; - * => - j = int c; - set[j] = (tkcmd(t, "variable c"+c) == "1"); + alt{ + s := <-t.ctxt.kbd => + tk->keyboard(t, s); + s := <-t.ctxt.ptr => + tk->pointer(t, *s); + c := <-cmd => + case c { + "ok" => + break loop; + "cancel" => + return; + * => + j = int c; + set[j] = (tkcmd(t, "variable c"+c) == "1"); + } } } for(j=0; j