mirror of
https://github.com/gdamore/tcell.git
synced 2025-04-24 13:48:51 +08:00

The WidgetWatchers struct is designed to be embedded into custom widgets in order to satisfy the WidgetWatcher interface. The implementation uses an internal map for storing EventHandlers, but does not lock access to the access of the map within each method. A race condition can occur if Watch, Unwatch, or any event is Posted from separate goroutines. Lock access to the internal map. When posting an event, create a deep copy of the map for iterating. This prevents potential deadlocks from a widget calling Unwatch while handling an event.
tcell views
This package provides some enhanced functionality on top of base tcell. In particular, support for logical views, and a few different kinds of widgets like title bars, and scrollable areas, are provided.
These make up a higher level interface than tcell itself.