events

package
v0.6.9-alpha.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenId

func GenId() string

Types

type Event

type Event struct {
	tcell.Event

	Type string
	Path string

	From string
	To   string

	Data interface{}
	// contains filtered or unexported fields
}

func (*Event) When

func (E *Event) When() time.Time

type EventBus

type EventBus struct {
	EventStream *EventStream
	WgtMgr      WgtMgr

	Handler func(e Event)
	// contains filtered or unexported fields
}

func (*EventBus) AddGlobalHandler

func (EBus *EventBus) AddGlobalHandler(path string, handler func(Event))

func (*EventBus) AddWidgetHandler

func (EBus *EventBus) AddWidgetHandler(wgt tview.Primitive, path string, handler func(Event))

func (*EventBus) ClearGlobalHandlers

func (EBus *EventBus) ClearGlobalHandlers()

func (*EventBus) ClearWidgetHandlers

func (EBus *EventBus) ClearWidgetHandlers(wgt tview.Primitive)

func (*EventBus) Init

func (EBus *EventBus) Init(app *tview.Application) error

func (*EventBus) Merge

func (EBus *EventBus) Merge(name string, ec chan Event)

func (*EventBus) NewSysEvtCh

func (EBus *EventBus) NewSysEvtCh() chan Event

func (*EventBus) RemoveGlobalHandler

func (EBus *EventBus) RemoveGlobalHandler(path string)

func (*EventBus) RemoveWidgetHandler

func (EBus *EventBus) RemoveWidgetHandler(wgt tview.Primitive, path string)

func (*EventBus) SendCustomEvent

func (EBus *EventBus) SendCustomEvent(path string, data interface{})

func (*EventBus) Start

func (EBus *EventBus) Start() error

func (*EventBus) Stop

func (EBus *EventBus) Stop() error

type EventCustom

type EventCustom struct {
	*tcell.EventInterrupt
}

type EventError

type EventError struct {
	*tcell.EventError
}

type EventInterrupt

type EventInterrupt struct {
	*tcell.EventInterrupt
}

type EventKey

type EventKey struct {
	*tcell.EventKey
	KeyStr string
}

type EventMouse

type EventMouse struct {
	*tcell.EventMouse
	Press string
}

type EventResize

type EventResize struct {
	*tcell.EventResize
}

type EventStream

type EventStream struct {
	sync.RWMutex

	Handlers map[string]func(Event)
	// contains filtered or unexported fields
}

func NewEventStream

func NewEventStream() *EventStream

func (*EventStream) Handle

func (es *EventStream) Handle(path string, handler func(Event))

func (*EventStream) Hook

func (es *EventStream) Hook(f func(Event))

func (*EventStream) Init

func (es *EventStream) Init()

func (*EventStream) Loop

func (es *EventStream) Loop()

func (*EventStream) Merge

func (es *EventStream) Merge(name string, ec chan Event)

func (*EventStream) RemoveHandle

func (es *EventStream) RemoveHandle(path string)

func (*EventStream) ResetHandlers

func (es *EventStream) ResetHandlers()

Remove all existing defined Handlers from the map

func (*EventStream) StopLoop

func (es *EventStream) StopLoop()

type WgtInfo

type WgtInfo struct {
	Handlers map[string]func(Event)
	WgtRef   tview.Primitive
	Id       string
}

func NewWgtInfo

func NewWgtInfo(wgt tview.Primitive) WgtInfo

type WgtMgr

type WgtMgr map[string]WgtInfo

event mixins

func NewWgtMgr

func NewWgtMgr() WgtMgr

func (WgtMgr) AddWgt

func (wm WgtMgr) AddWgt(wgt tview.Primitive)

func (WgtMgr) AddWgtHandler

func (wm WgtMgr) AddWgtHandler(id, path string, h func(Event))

func (WgtMgr) ClearWgtHandlers

func (wm WgtMgr) ClearWgtHandlers(id string)

func (WgtMgr) RmWgt

func (wm WgtMgr) RmWgt(wgt tview.Primitive)

func (WgtMgr) RmWgtById

func (wm WgtMgr) RmWgtById(id string)

func (WgtMgr) RmWgtHandler

func (wm WgtMgr) RmWgtHandler(id, path string)

func (WgtMgr) WgtHandlersHook

func (wm WgtMgr) WgtHandlersHook() func(Event)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL