dragon8837
dragon8837
2018-11-02 11:21

termui的termui.Handle(“ / timer / 1s”,func(e termui.Event))在ubuntu 18.04上不起作用

已采纳

I'm working with golang and used termui library for a purpose. find ref here for the library.

termui.Handle("/timer/1s", func(e termui.Event) {
    if true {
        if true {
            strs = []string{"something"}
        } else {
           strs = []string{"something else"}
        }
        ls.Items = strs // ls := termui.NewList()
    } else {
        strs = []string{"something else"}
        ls.Items = strs
    }
    termui.Render(ls)
}) 

above code is to suppose write a text on terminal window but nothing is happend. I've not got any ref or solution regarding same. above code is working on windows but not in ubuntu 18.04.

also

termui.Handle("/sys/kbd/C-c", func(termui.Event) {
    termui.StopLoop()
}) 

above code working on windows but not in ubuntu 18.04.

Please provide a solution or alternatives for above.

thanks in advance.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doulong6761 doulong6761 3年前

    Here I'm answering my own question. Owner of library change their events and functions. They deprecated /timer/1s and force user to use Gos build in timer. here is library changes and documentation

    点赞 评论 复制链接分享

相关推荐