mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[PR #368] Add support for displaying text next to a checkbox #929
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#929
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?
📋 Pull Request Information
Original PR: https://github.com/rivo/tview/pull/368
Author: @berrange
Created: 11/14/2019
Status: 🔄 Open
Base:
master← Head:checkbox-text📝 Commits (1)
7e75a30Add support for displaying text next to a checkbox📊 Changes
3 files changed (+27 additions, -3 deletions)
View changed files
📝
checkbox.go(+26 -2)📝
demos/checkbox/main.go(+1 -1)📝
demos/checkbox/screenshot.png(+0 -0)📄 Description
When building forms the label field is typically quite short, just one
or two words. For checkboxes it is often desirable to have a longer
descriptive piece of text. This is not practical to use as a label and
in many applications would more commonly be placed to the right of the
checkbox.
This adds support for a "SetMessage()" method which provides support
for text adjacent to the checkbox
As an example, this form shows one usage pattern, where the checkbox
is used to require case sensitive matching of the author name query.
In this case the checkbox label is an empty string, and the message
text is used instead:
Another pattern is where there are a series of checkboxes, all
related to the same attribute. Thus they have a common form
label but different message text
Signed-off-by: Daniel P. Berrangé berrange@redhat.com
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.