Hay guys!
It seems, that hooks are one-offs - when I use (click:) and (mouseover:) sensor macros on some hook, I can't use them on this hook again (so, when I click on hook, or move mouse cursor over it, it does what it has to and then becomes unavaiable).
I've figured out, that I can re-animate hooks using (live:) macros.
My question is:
Is there any way to make hooks re-usable without (live:) macros and re-entering current passage?
Thanks
Comments
If you look at the HTML generated by a hook without any associated sensor macros it is just the related text wrap in a <tw-hook> tag, so: When you attach a sensor macro to the hook the generated HTML changes: When you click on the link the HTML dynamically changes to: As you will notice, the <tw-enchantment> (and the code associated with the tag) is dynamically removed when the link was clicked and this is basically why you need to re-attach a new sensor macro to re-enable the hook.
Still, I guess I found a workaround to solve this. Basically, I replace hooks with (display:) of passages, in which I store my mouseover macros, which also call display of themselves, so it is a recursion of some kind. I'll give more info and examples of the code after investigating this further.
Added: so, here is my explanation.
The main thing is, you'll have to put your sensor macros into another passage. Lets call it click_macros You will see these ?description and ?code hooks in the main passage: So, as you see, click_macros passage code replaces itself into ?code hook every time I click the ?c1 hook, and so it lives.
I'll attach this example as "re-usable hooks" and another one a bit more complex, but fancier example with both (click:) and (mouseover:), maybe somebody will find them useful