mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #847] How to access Custom Events from the Event Loop? #617
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#617
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @devppratik on GitHub (May 9, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/847
The tcell-term is a library based on tcell. At the moment, it has a custom event that determines if the terminal has exited or not.
How do I access this event in tview?
Is there a way to call this event and then use it in the application?
@devppratik commented on GitHub (May 10, 2023):
I figured out I can queue a event using the QueueEvent function but how do I access the event from the app event loop itself??
@rivo commented on GitHub (Jun 18, 2023):
There is currently no way to do this. Can you provide some context? What do you want to achieve with these custom events?
@devppratik commented on GitHub (Jul 3, 2023):
@rivo @digitallyserviced
https://git.sr.ht/~rockorager/tterm is a library based on https://git.sr.ht/~rockorager/tcell-term for t view.
This allows to use a terminal as a view for tview. It works quite well and without any issues.
I am trying to create a TMux sort of application using this library
However, when the shell exits (e.g. the user typed user) tcell-term emits a
EventClosedevent to let the user know that the terminal has exited. I would like to capture theEventClosedin tview and then perform a set of actions accordingly.@devppratik commented on GitHub (Jul 4, 2023):
This really solved what I wanted to do!
Thanks!!