[GH-ISSUE #803] checkbox style #586

Closed
opened 2026-03-04 01:06:15 +03:00 by kerem · 4 comments
Owner

Originally created by @vendelin8 on GitHub (Jan 29, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/803

Hi,

Nice library, thanks!
I have an issue with how the checkbox looks like, or rather that it's too invisible for me. I tried to find unicode characters, eg. ☐ but it's very small in my terminal, doesn't help too much.

So my other choice would be eg. wrapping the original solution inside square brackets like [X] and [ ]. It would be still the smallest widget, and I think the only downside of this would be (other than most likely backward incompatibility) when someone wants them very dense eg. a minesweeper. But for a minesweeper I'd choose a more lightweight solution anyway than hundreds of checkbox widgets.

What do you think?

Originally created by @vendelin8 on GitHub (Jan 29, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/803 Hi, Nice library, thanks! I have an issue with how the checkbox looks like, or rather that it's too invisible for me. I tried to find unicode characters, eg. ☐ but it's very small in my terminal, doesn't help too much. So my other choice would be eg. wrapping the original solution inside square brackets like `[X]` and `[ ]`. It would be still the smallest widget, and I think the only downside of this would be (other than most likely backward incompatibility) when someone wants them very dense eg. a minesweeper. But for a minesweeper I'd choose a more lightweight solution anyway than hundreds of checkbox widgets. What do you think?
kerem 2026-03-04 01:06:15 +03:00
Author
Owner

@carpii commented on GitHub (Feb 9, 2023):

As a workaround in the meantime, you could pad it with spaces a little...

NewCheckbox().SetCheckedString(" X ")
<!-- gh-comment-id:1424700992 --> @carpii commented on GitHub (Feb 9, 2023): As a workaround in the meantime, you could pad it with spaces a little... NewCheckbox().SetCheckedString(" X ")
Author
Owner

@vendelin8 commented on GitHub (Feb 9, 2023):

As a workaround in the meantime, you could pad it with spaces a little...

NewCheckbox().SetCheckedString(" X ")

Yeah, that would work, but I'd prefer something more visible. I already have my workaround in my fork, but I think it would be rejected as a PR because it's not really backward compatible.
github.com/vendelin8/tview@8100641891

<!-- gh-comment-id:1424724718 --> @vendelin8 commented on GitHub (Feb 9, 2023): > As a workaround in the meantime, you could pad it with spaces a little... > > ``` > NewCheckbox().SetCheckedString(" X ") > ``` Yeah, that would work, but I'd prefer something more visible. I already have my workaround in my fork, but I think it would be rejected as a PR because it's not really backward compatible. https://github.com/vendelin8/tview/commit/8100641891906f9b03e18330697a01c8e58dfba0
Author
Owner

@petrsx commented on GitHub (Dec 24, 2023):

Same here. Collapsed node with prefix [+], expanded node with prefix [-].

I think this was solved in https://github.com/rivo/tview/issues/803 like that?

node.SetText(tview.Escape("[-]") + resource.Address)
<!-- gh-comment-id:1868569692 --> @petrsx commented on GitHub (Dec 24, 2023): Same here. Collapsed node with prefix `[+]`, expanded node with prefix `[-]`. I think this was solved in https://github.com/rivo/tview/issues/803 like that? ```golang node.SetText(tview.Escape("[-]") + resource.Address) ```
Author
Owner

@rivo commented on GitHub (Jan 1, 2024):

The latest commit, github.com/rivo/tview@b3bd1aa5e9, adds the SetUncheckedString function. Together with SetCheckedString, this should allow you to customize the checkbox to your needs.

<!-- gh-comment-id:1873358100 --> @rivo commented on GitHub (Jan 1, 2024): The latest commit, https://github.com/rivo/tview/commit/b3bd1aa5e9f23ba61af8160d1021dab4df701eb0, adds the `SetUncheckedString` function. Together with `SetCheckedString`, this should allow you to customize the checkbox to your needs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#586
No description provided.