mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #48] Problem with Flex horizontal size #36
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#36
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 @genzi on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/48
I want to use a table like kind of display. To visualize something I will call display.GetCell(px, py).SetBackgroundColor(tcell.ColorGreen) function when pixel should be on.
The code above should make "display" 64 x 32. Vertical size is OK (32; +2 for border), but horizontal size is less than 64.
@rivo commented on GitHub (Jan 30, 2018):
Hi,
You're correctly setting the required width to
64+2in theFlexview. (TheSetRect()call is not needed.) When I tried your example, the width ofdisplaygot set to 64 or 66 with the border. See here:I'm counting 32 vertical bars with one blank cell after each one = 64.
If you're getting a different output for this code, maybe you can include a screenshot.
@genzi commented on GitHub (Jan 30, 2018):
Hi,
Thank you for the answer. I didn't know that in a table there is additional blank cell after each one.
I that case I should set flex fixedSize to 128. I will try it in that way.
I know that this is "table" not "display" object, but is there a way to remove blank cells?
Because this breaks my "display" probably. Or can you suggest a different way to reach my goal?
Sorry for questions about not standard use your package.
@rivo commented on GitHub (Jan 30, 2018):
Currently, the character between columns cannot be removed. But you can change it to something else than a blank character with
SetSeparator():If you don't need the other
Tablefunctionality such as scrolling and selections, I would suggest usingTextViewinstead. Just draw your bars into it:You can change colors like this:
or like this: