From: Paul on
On May 31, 11:46 am, "Donal K. Fellows"
<donal.k.fell...(a)manchester.ac.uk> wrote:
> On 31/05/2010 11:04, Paul wrote:
>
> > Now all I've got to do is move the cursor. I can move it by:
>
> > .myentry icursor $newPos
>
> > The newPos variable needs to be set to current position + 1, so that
> > it's between the braces, but I can't find how to get the current
> > position. I'm sure it's there somewhere, just can't see it....
>
> The current position is returned by:
>
>     .myentry index insert
>
> Donal.

Thanks for all the responses,

Paul.
From: Robert Heller on
At Mon, 31 May 2010 12:42:23 +0200 Uwe Klein <uwe_klein_habertwedt(a)t-online.de> wrote:

>
> Paul wrote:
> > On May 31, 9:49 am, Colin Macleod <colin.macl...(a)tesco.dot.net.nospam>
> > wrote:
> >
> >
> >>You can fix this version by adding a break to prevent further processing of
> >>the keystroke, ie. (not tested):
> >>bind .myentry <leftbrace> {.cmd insert insert \{ \}; break}
> >
> >
> > Thanks, that works.
> >
> > Now all I've got to do is move the cursor. I can move it by:
> >
> > .myentry icursor $newPos
> >
> > The newPos variable needs to be set to current position + 1, so that
> > it's between the braces, but I can't find how to get the current
> > position. I'm sure it's there somewhere, just can't see it....
>
> entry .en; pack .en
>
> bind .en <leftbrace> {
> event generate .en <rightbrace>
> event generate .en <Left>
> }

bind .en <braceleft> {
event generate .en <braceright>
event generate .en <Left>
}

Seems to work better. :-)

>
> uwe
>

--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller(a)deepsoft.com -- Contract Programming: C/C++, Tcl/Tk