• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dual Purpose Applet Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dual Purpose Applet Question


  • Subject: Re: Dual Purpose Applet Question
  • From: email@hidden
  • Date: Tue, 5 Dec 2000 17:49:38 -0500

On Tue, 05 Dec 2000 16:40:14 +0000, From: Mr Tea <email@hidden> asked,

> At the risk of revealing my ignorance (generally a good idea when one wishes
> to learn something), I started out with the following test script:
>
> on open
> beep 1
> end open
> on run
> beep 2
> end run
>
> Sure enough, it beeps when I drag something onto it, but does nothing when I
> double-click. Clearly the latter is different to running the script, as it
> obediently beeps twice when run from the script editor. Where do I go from
> here?

If the applet was "stay open", and you double click on it after it is running,
it doesn't get sent a "run" event.

The solution is to provide a "reopen" handler

on reopen
beep 3
end reopen

The initialization logic in complex programs can get tricky, because you may get
"reopen" after an "open", or you may get it after a "run". But in your case,
you probably can just make the "reopen" handler just call "run".

--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden


  • Follow-Ups:
    • Re: Dual Purpose Applet Question
      • From: John W Baxter <email@hidden>
  • Prev by Date: Re: he's ranting again (Was: Re: Month as Integer (or he's ranting again))
  • Next by Date: Math/Geometry Guru anyone?
  • Previous by thread: Re: Re: Dual Purpose Applet Question
  • Next by thread: Re: Dual Purpose Applet Question
  • Index(es):
    • Date
    • Thread