cl-glfw3 icon indicating copy to clipboard operation
cl-glfw3 copied to clipboard

does def callback block printing to repl?

Open izz-j opened this issue 7 years ago • 1 comments

I try to call princ and format inside a def callback to print the key value when pressed, but I do not get an output. I don't want to print the keys to show up in the title bar like in the event.lisp example. Is there anyway to do this?

izz-j avatar Jun 22 '17 13:06 izz-j

@izz-j

You need to use FINISH-OUTPUT, or FORCE-OUTPUT.

In systems with buffered output streams, some output remains in the output buffer until the output buffer is full (then it will be automatically written to the destination) or the output buffer is emptied.

(format t "Hello, world!~%")
(force-output)

https://stackoverflow.com/a/2078561

tavurth avatar Sep 18 '17 19:09 tavurth