console.go 621 B

123456789101112131415161718192021222324252627282930
  1. package widget
  2. import "fmt"
  3. // import . "gitlab.com/beoran/ebsgo/zori/types"
  4. // import _ "gitlab.com/beoran/ebsgo/zori/backend"
  5. // import "gitlab.com/beoran/ebsgo/zori/state"
  6. // import "gitlab.com/beoran/ebsgo/zori/style"
  7. import "gitlab.com/beoran/ebsgo/zori/event"
  8. type Console struct {
  9. Basic
  10. Lines []string
  11. Input string
  12. Cursor int
  13. }
  14. func (cw * Console) Dispatch(ev event.Event) event.Result {
  15. return event.Dispatch(ev, cw)
  16. }
  17. func (cw *Console) KeyChar(kc event.KeyChar) event.Result {
  18. cw.Basic.KeyChar(kc)
  19. fmt.Println("KeyChar of ConsoleWidget")
  20. return event.Result(true)
  21. }