Github.com/jroimartin/gocui -- How to update on demand? [SOLVED]

I’m using gocui to create a better console front-end to a Java stdin/stdout/stderr program.
I have succeeded in:

  • creating an input view
  • creating an output view
  • writing input lines from the input view to my Java app (stdio)
  • receiving and displaying output from my Java app (stdout/stderr) in the output view

However, as gocui only updates all views as it processes an event, output from the asynchronous execution of my Java program in response to input comes only after the input event processing is completed, so the output doesn’t actually appear in the output view until, say, the next key event.

I am grasping at straws such as trying to figure out how to send an empty event via github.com/nsf/termbox-go which underlies gocui to cause an update of the output view.

Any tips or pointers appreciated.

| Figured it out. I can use
| termbox.Interrupt() which causes an event and the view holding the asynchronous output is updated.

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.