Im trying to make it so that when the user clicks a button, it becomes \"X\" or \"0\" (Depending on their team). How can I make it so that the text on the button is updated?
btn is just a dictionary of values, lets see what comes up then:
#lets do another button example
Search_button
#hmm, lets do dict(Search_button)
dict(Search_button)
{'activebackground': 'SystemButtonFace', 'activeforeground':
'SystemButtonText', 'anchor': 'center', 'background': 'SystemButtonFace',
'bd': , 'bg': 'SystemButtonFace', 'bitmap': '',
'borderwidth': , 'command': '100260920point', 'compound':
'none', 'cursor': '', 'default': 'disabled', 'disabledforeground':
'SystemDisabledText', 'fg': 'SystemButtonText', 'font': 'TkDefaultFont',
'foreground': 'SystemButtonText', 'height': 0, 'highlightbackground':
'SystemButtonFace', 'highlightcolor': 'SystemWindowFrame',
'highlightthickness': , 'image': '', 'justify': 'center',
'overrelief': '', 'padx': , 'pady': ,
'relief': 'raised', 'repeatdelay': 0, 'repeatinterval': 0, 'state':
'normal', 'takefocus': '', 'text': 'Click me for 10 points!',
'textvariable': '', 'underline': -1, 'width': 125, 'wraplength': }
#this will not work if you have closed the tkinter window
As you can see, it is a large dictionary of values, so if you want to change any button, simply do:
Button_that_needs_to_be_changed["text"] = "new text here"
Thats it really!
It will automatically change the text on the button, even if you are on IDLE!