Skip to content

Clear IO messages #1407

Answered by jonatanklosko
BrooklinJazz asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @BrooklinJazz! One of the things you can do is this:

for _ <- Kino.Control.stream(button) do
  IO.write("\rPRESSED BUTTON! #{DateTime.utc_now()}")
end

Note that we use IO.write so no newline is added, and \r clears that line next time we print.

There's also kino frame where you can replace the whole content.

Finally, in kino main we have Kino.animate/2, which could do pretty well here.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by BrooklinJazz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants