Finding out a TextMorph cursor position

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding out a TextMorph cursor position

Marcus Strehlow
Hi guys,

short question. Is it possible to find out the cursor position of the cursor as I type? I mean in terms of a numerical position? Like when I type 'abc' into an empty field, the cursor position should be 3. But when I click somewhere, say between the a and b, the cursor location should return 1. Is it possible to find this out? For two hours I'm looking in any conceivable code and have not found anything for it.

Thanks guys

Marcus



-- 
iMac -- 20 inch -- Core 2, 2 GHz -- 1 GB RAM -- Superdrive -- Mac OS X Leopard 10.5.2
MacBook -- 13.3 inch -- Core 2, 1.83 GHz -- 1.5 GB RAM -- Combodrive -- Mac OS X Leopard 10.5.2
iMac G5 -- 17 inch -- PPC G5 1.8 GHz -- 1 GB RAM -- Superdrive -- Mac OS X Leopard 10.5.2
iPod touch -- 16 GB -- Software Upgrade -- OS X 1.1.4


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Finding out a TextMorph cursor position

Scott Wallace-2
Hi, Marcus,

Try:

aTextMorph editor selectionInterval start

Cheers,

-- Scott


----- Original Message ----
From: Marcus Strehlow <[hidden email]>
To: [hidden email]
Sent: Monday, March 17, 2008 11:59:58 AM
Subject: [Newbies] Finding out a TextMorph cursor position

Hi guys,

short question. Is it possible to find out the cursor position of the cursor as I type? I mean in terms of a numerical position? Like when I type 'abc' into an empty field, the cursor position should be 3. But when I click somewhere, say between the a and b, the cursor location should return 1. Is it possible to find this out? For two hours I'm looking in any conceivable code and have not found anything for it.

Thanks guys

Marcus



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners