Documentation ¶
Index ¶
- Constants
- type Component
- type ComponentManager
- func (eh *ComponentManager) Broadcast(event EventMsg)
- func (eh *ComponentManager) CurrentComponent() Component
- func (eh *ComponentManager) PopComponent()
- func (eh *ComponentManager) PushComponent(component Component, subcomponents ...Component)
- func (eh *ComponentManager) SendTo(component Component, event EventMsg)
- func (eh *ComponentManager) Subscribe(component Component) chan EventMsg
- func (eh *ComponentManager) Unsubscribe(component Component, listener chan EventMsg)
- type EventMsg
- type Listener
Constants ¶
View Source
const (
GlobalComponent = "Global"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentManager ¶
type ComponentManager struct {
// contains filtered or unexported fields
}
ComponentManager is a helper to manage different Components and their key handlers, so that only the key handlers of the current component are executed
func NewComponentManager ¶
func NewComponentManager() *ComponentManager
NewComponentManager creates a new ComponentManager
func (*ComponentManager) Broadcast ¶
func (eh *ComponentManager) Broadcast(event EventMsg)
Broadcast sends an event to a specific component
func (*ComponentManager) CurrentComponent ¶
func (eh *ComponentManager) CurrentComponent() Component
CurrentComponent returns the current component
func (*ComponentManager) PopComponent ¶
func (eh *ComponentManager) PopComponent()
PopComponent removes the latest component from the component stack
func (*ComponentManager) PushComponent ¶
func (eh *ComponentManager) PushComponent(component Component, subcomponents ...Component)
PushComponent adds a new component to the component stack
func (*ComponentManager) SendTo ¶
func (eh *ComponentManager) SendTo(component Component, event EventMsg)
BroadcastTo sends an event to a specific component
func (*ComponentManager) Subscribe ¶
func (eh *ComponentManager) Subscribe(component Component) chan EventMsg
Subscribe subscribes to events from a specific component
func (*ComponentManager) Unsubscribe ¶
func (eh *ComponentManager) Unsubscribe(component Component, listener chan EventMsg)
Unsubscribe unsubscribes from events from a specific component
Click to show internal directories.
Click to hide internal directories.