View Single Post
Old 29 June 2020, 19:39   #6
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,114
Quote:
Originally Posted by Sim085 View Post
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.
Thomas Richter is offline  
 
Page generated in 0.05594 seconds with 11 queries