awesome-gocui / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
344 stars 39 forks source link

Example with subprocess #120

Closed Thijxx closed 2 years ago

Thijxx commented 2 years ago

Describe the feature you'd like I would like to be able to understand, using the examples, how I can do anything in my application besides running the UI. To me it looks like I need to write all my code in the layout() function since it's a blocking process. It takes no arguments so I would not know how to make an application using the UI although the UI itself is working great.

Describe alternatives you've considered I've read the cointop code to try to understand how to run more than just the UI in an application but I see so many layers of abstraction that I get confused.

Additional context Do I create the UI, then call into it to update or do I create a backend process within the UI or do I need to create a channel within the layout() so I can channel in updated data? I noticed I cannot run SetManagerFunc in a Go routine and everything after this function runs only when the application closes.

Thijxx commented 2 years ago

As usual I find what I was looking for right after asking for it: https://github.com/awesome-gocui/gocui/blob/master/_examples/goroutine.go