[comp.sys.mac.hypercard] Disapearing insertion point

martin@m2.csc.ti.com (Steven Martin) (05/01/90)

In article <2107@bruce.OZ> younger@bruce.OZ (Chris Younger) writes:
>The problem:
>I am trying to create a card that contains various entry fields and a field
>showing the Current Time.  However, when using the "on idle" script as in the
>Home Card the insertion point disapears every time the "time" field is updated
>and is not returned to the field I was working in.  Is there some way of
>getting the cursor to return to the last open field or will I need to disable
>the clock while working in other fields to stop the cursor from disapearing?

Try this:

on idle
  if the time is not field "time" then
  -- "if" so you don't update it needlessly
    get the selectedchunk
    -- preserve what was selected
    put the time into field "time"
    select it
    -- reselect what was selected
  end if
end idle

Steve Martin            USENET: {ctvax,im4u,texsun,rice}!ti-csl!martin
The opinions in this    ARPANET: SMARTIN@CSC.TI.COM  COMPUSERVE: 72727,1471
article are my own.     PHONE: (214)-995-0387, 404-1061
I'm at a loss for quotes.  - SM