Enhancements in your opinion?

Ken Ray kray at sonsothunder.com
Tue May 9 12:36:05 EDT 2006


On 5/9/06 1:42 AM, "Bob Warren" <bobwarren at howsoft.com> wrote:

> Following Ken Ray's suggestion and also looking in the Help, I put the
> this into my card script:
> 
> on newTool toolName
>    if toolName is "Browse" then  beep
> end newTool
> 
> I don't get a beep when I change from another tool to the browse tool.
> Is it just tiredness (it's 3.30 in the morning) or am I a ninny anyway
> (or worse, a tired ninny)?

No, it's just that I forgot that even though the message is sent, it's not
sent to *your* stack... you see the message travels from the point that the
"choose <tool>" command is executed, on through the hierarchy. Which means
that frontscripts get the message first, followed by the card/stack where
the command was executed (the Rev tools palette), and then continuing on to
libraries and backscripts. So your stack is never sent the message...

The only way to trap it is to insert your own frontScript (or backscript)
into the hierarchy - a simple button with your script above, inserted in
your first preOpenStack (or openStack) call:

  insert script of btn "NewToolTrap" into front

>From that point on, you'll get the message...

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list