Re: position

From: Alan Horkan <horkana_at_maths.tcd.ie>
Date: Tue Feb 10 2009 - 03:13:35 CET

On Mon, 9 Feb 2009, J.M. Maurer wrote:

> Date: Mon, 09 Feb 2009 12:20:10 +0100
> From: J.M. Maurer <uwog@uwog.net>
> To: Martin Sevior <msevior@gmail.com>
> Cc: Daniel Carvalho <idnael@gmail.com>, abiword-dev@abisource.com
> Subject: Re: position
>
>
> On Mon, 2009-02-09 at 11:36 +1100, Martin Sevior wrote:
> > HI Daniel,
> > You are correct. There is no method that returns the
> > current caret position, nor is their method that sets the caret
> > position to an absolute location. There are numerous methods that move
> > the caret about the place, like start/end of document, starte/end of
> > line, search for text etc.
> >
> > The currently implemented methods in the Pyhton bindings re those
> > needed for the "Write" application used by the One Laptop Per Child
> > project as well as our guesses as to what would be usefula nd easy to
> > implement.
> >
> > It is actually extremely easy to add the two methods you requested and
> > I'm happy to do this.
> >
> > I guess you want:
> >
> > int getCurrentCaretPos()
> > void setCaretPos(int ipos)

Instead of "current" wouldn't it just be getCaretPostion?
Why would you abbreviate Position to Pos, or drop the word Position
altogether?

Keeping AbiCollab in mind would you need to have a way to get the postion
of Caret N, N+1, ... (perhaps that would simply be an additional argument
to the getCaret API).

> > I could also implement:
> >
> > void setSelection(int posLow, int posHigh)
>
> ... especially since you need to know rather low level AbiWord stuff to
> really know what those positions are.

Presumably this is needed so that after something like a find and replace
you can just put the caret back to where it was before the a script was
exectuted? I guess what Daniel is trying to do will matter in the short
term but that you'd want the more generic functions in the long term in
any case.

-- 
Alan
Received on Tue Feb 10 03:13:40 2009

This archive was generated by hypermail 2.1.8 : Tue Feb 10 2009 - 03:13:40 CET