mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #486] Border stops treeview rendering properly #352
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#352
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rmasp98 on GitHub (Aug 18, 2020).
Original GitHub issue: https://github.com/rivo/tview/issues/486
Hi,
This is a really cool library and hoping to use it on my project!
The issue is that when creating a TreeView, if you call SetBorder(true) on the object, it stops the contents of the treeview from rendering. The really simple example below should hopefully reproduce:
This should display the word "Test" with a border around the outside of the window but "Test" is not rendered.
OS: Arch Linux
Go version: 1.14.6
tview version: master (c65badfc3d...)
Happy to help fix the problem but might need some pointers around the code base (still fairly new to go)
@rivo commented on GitHub (Sep 15, 2020):
That's because the
SetBorder()function is actually a function ofBoxand it returns a*tview.Box. So yourtreevariable is an instance ofBoxand it will call theDraw()function ofBoxto draw itself instead of callingTreeView.Draw(). Boxes are just empty boxes without any content.Here's what you should do to ensure that
treeis a*tview.TreeView:Let me know if this answers you question.
@rivo commented on GitHub (Nov 17, 2020):
If you still require information, please open another issue and reference this one.