[squeak-dev] continuous display of cursor position

Casey Ransberger casey.obrien.r at gmail.com
Sat Jan 5 04:50:43 UTC 2013


Also, Maui is an incredible thing. There is a small gestural learning curve to it, but it's fantastic and becomes natural very quickly. It's worth loading up just for *fun.*

C

On Jan 4, 2013, at 8:49 AM, Chris Muller <asqueaker at gmail.com> wrote:

> This is a piece of cake with Maui.
> 
> 1) Install Maui (1.4) or (head) from SqueakMap.
> 2) Type "ActiveHand maui" (without quotes, of course :) and Do It.
> 3) Set the "a HandMorph(1234)" box down, press the "c" key on it -- a
> browser opens up on HandMorph.
> 4) Drag the #position  message to the box.
> 5) On the embedded #position message, press "e" key on edit its settings.
> 6) In the #repeat: message, click on the "false" object to toggle it to true.
> 7) In #repeatInterval: box, type 10 and press Enter.
> 
> Done (see screenshot).
> 
> Maui might be overkill for only this, but you can see you can have a
> watch on any message, not just the Hand position.  And there are
> benefits of developing with a naked-objects drag-and-drop UI builder
> because it forces good "usability" out of API's you design while
> providing an easy, codeless way to _operate_ your domain model.  I
> really like it.
> 
> 
> 
> On Thu, Jan 3, 2013 at 8:50 PM, Ralph Boland <rpboland at gmail.com> wrote:
>> I would like to create a small TextMorph that continuously displays the position
>> of the cursor.  To do this I need to write something of the form:
>> 
>> true whileTrue: [
>>    x := self getCursorPosition.
>>    textMorph display: x.
>>    self sleep:  10   "milliseconds"]
>> 
>> I plan to use this when investigating some morph that is not displaying the way
>> I expect it to.
>> 
>> Can someone provide me with hints as how to properly do this or point
>> me to a package that already does this or something similar?
>> 
>> I have searched the code and the Internet.  I found that "getCursorPosition"
>> can be implemented as:
>> 
>>     "World activeHand position"
>> 
>> I can also figure out how to build the Morph I need to display the
>> Cursor position.
>> 
>> I don't know how to implement "sleep:"
>> I am not sure if I should use an infinite loop as I have.
>> 
>> An alternative to the TextMorph I want is to construct a cursor that
>> continuously displays its
>> position but I prefer my original plan.
>> 
>> Any help much appreciated.
>> 
>> Ralph Boland
>> 
> <maui.png>
> 


More information about the Squeak-dev mailing list