We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Please consider the simplified example below.
I want to change the color of "otherButton" if "button" is pressed. Pressing the "button" doesn't change the Label color of the "otherButton".
otherButton.SetLabel will change the text of the button however... What am I missing?
package main import ( "log" "github.com/gdamore/tcell/v2" "github.com/rivo/tview" ) var ( button *tview.Button otherButton *tview.Button ) func main() { app := tview.NewApplication() grid := tview.NewGrid() button = tview.NewButton("Ok").SetSelectedFunc(func() { //otherButton.SetLabel("42") otherButton.SetLabelColor(tcell.ColorRed) }) otherButton = tview.NewButton("Other") grid. AddItem(button, 0, 0, 1, 1, 0, 0, true). AddItem(otherButton, 2, 0, 1, 1, 0, 0, false) if err := app.SetRoot(grid, true).Run(); err != nil { log.Fatalf("Error") } app.SetFocus(button) }
Thanks in advance!
The text was updated successfully, but these errors were encountered:
When I'm trying your code, it does what it's supposed to do:
After pressing Enter otherButton is the same text ("Other") but with a red label.
otherButton
So I'm not sure what you're seeing on your end. Can you run this exact code and send a screenshot?
Sorry, something went wrong.
No branches or pull requests
Hello,
Please consider the simplified example below.
I want to change the color of "otherButton" if "button" is pressed. Pressing the "button" doesn't change the Label color of the "otherButton".
otherButton.SetLabel will change the text of the button however... What am I missing?
Thanks in advance!
The text was updated successfully, but these errors were encountered: