Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

text widget-cursor position

0 views
Skip to first unread message

josri

unread,
Jul 2, 1998, 3:00:00 AM7/2/98
to

Hi
How do I get the cursor position in text widget? eg.line number 5 column
number 6. And not x,y position with XEvent()
Thanks for any help!

Regards
Josri


Andrew Allen

unread,
Jul 3, 1998, 3:00:00 AM7/3/98
to

josri (jo...@postoffice.pacbell.net) wrote:
: Hi

: How do I get the cursor position in text widget? eg.line number 5 column
: number 6. And not x,y position with XEvent()

Not exactly obvious from the documentation... you need to get the
index of the (special) mark called 'insert':

$pos=$textwidget->index('insert');

Andrew

josri

unread,
Jul 7, 1998, 3:00:00 AM7/7/98
to Andrew Allen
Hi AndrewThanks for your help. But, can you give me a small example which uses
"mark" with text widget or some example on the web. I am also not clear with
the documentation.

> : How do I get the cursor position in text widget? eg.line number 5 column
> : number 6. And not x,y position with XEvent()
>
> Not exactly obvious from the documentation... you need to get the
> index of the (special) mark called 'insert':
>
> $pos=$textwidget->index('insert');

RegardsJosri


josri

unread,
Jul 7, 1998, 3:00:00 AM7/7/98
to jo...@pacbell.net
Hi Andrews
Thanks for your help!
It worked :-)

Regards
Josri

0 new messages