home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / tcl / 2322 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: bind problem
  5. Date: 8 Jan 1993 21:39:25 GMT
  6. Organization: U.C. Berkeley Sprite Project
  7. Lines: 33
  8. Distribution: world
  9. Message-ID: <1iksad$840@agate.berkeley.edu>
  10. References: <1993Jan07.150404.10636@rchland.ibm.com>
  11. NNTP-Posting-Host: tyranny.berkeley.edu
  12.  
  13. In article <1993Jan07.150404.10636@rchland.ibm.com>, shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall) writes:
  14. |> How come I can do 
  15. |> 1)    bind . <FocusIn> {puts stdout "focus in"}
  16. |>   but not
  17. |> 2)    bind . <FocusIn> +{puts stdout "focus in"}
  18. |>   or
  19. |> 3)    bind . <FocusIn> +{puts stdout focus_in}
  20. |> 
  21. |> (2) results in the error message
  22. |>     extra characters after close-quote
  23. |> while (3) results in the message
  24. |>     wrong # args: should be "bind window ?pattern? ?command?"
  25. |> 
  26. |> Both (2) and (3) seem to be problematic due to Tcl's parsing of the
  27. |> command, probably because they begin with `+'.  Is this intentional?  If
  28. |> not, perhaps the bind command could take a -append flag to allow forms
  29. |> such as (2) and (3) while of course maintaining the current syntax.
  30. |> 
  31. |> I realize this is easy enough to work around, but it is occasionally
  32. |> annoying (more so of late).
  33. |> 
  34. |> This is with tk2.3, AIX 3.2.2, x11r4.
  35. |> -- 
  36. |> : jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
  37. |> : shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.
  38.  
  39. The problem is that you put the "+" outside of the braces, and the Tcl
  40. parser only recognizes an open brace if it's the first character of a
  41. command word.  If you just say
  42.  
  43. bind . <FocusIn> {+puts stdout "focus in"}
  44.  
  45. I'll bet that everything will be fine.
  46.