Open1

開発メモ

シンシン

tviewのListで、いきなりListにtitleやborderを付けるとListが表示されない。

  • ダメな例
commands := tview.NewList().
	AddItem("List item 1", "Some explanatory text", 'a', nil).
	AddItem("List item 2", "Some explanatory text", 'b', nil).
	AddItem("List item 3", "Some explanatory text", 'c', nil).
	AddItem("List item 4", "Some explanatory text", 'd', nil).
	AddItem("Quit", "Press to exit", 'q', func() {
		tuiApp.Stop()
        }).
        SetBorder(true).
        SetTitle("Commands")
  • OKな例
commands := tview.NewList().
	AddItem("List item 1", "Some explanatory text", 'a', nil).
	AddItem("List item 2", "Some explanatory text", 'b', nil).
	AddItem("List item 3", "Some explanatory text", 'c', nil).
	AddItem("List item 4", "Some explanatory text", 'd', nil).
	AddItem("Quit", "Press to exit", 'q', func() {
		tuiApp.Stop()
})
commands.SetBorder(true)
commands.SetTitle("Commands")

仕様なのかどうかissue見てみる