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