Quote:
Originally Posted by Sim085
I have another question with regards to hooks. I have added a hook to a STRING_KIND gadget. Everything works fine if I handle the input from as IDCMP_GADGETUP message. However if I put a printf in the hook function everything will freeze up (even mouse pointer, need to restart). Why does this happen? Do I need to use some command before and after the printf so that this does not happen.
|
No, this cannot work. The best you can do is to print a string over the serial port. Or use a low-level debugger like COP.
The string hook is called from intuition when receiving input events, and thus within the intuition input handler, which keeps many intuition resources locked. Printing requires (through many indirection layers) locking the same resources, so this blocks forever.