btn is overwritten on each pass through the for, so btn contains the last button after the loop is finished. Use partial to send the button number to the function. See my post at https://python-forum.io/Thread-Tkinter-T...ht=tkinter for an example of how it is done. You can ignore/remove the class (self.) in your program, but you will have to use a list or dictionary to store the button instances if you want to use them in the function to modify the buttons. Modify your code and post back if you have problems.
Problem with buttons
Problem with buttons
|
|
Messages In This Thread |
Problem with buttons - by Epilepsy - May-12-2018, 05:13 AM
RE: Problem with buttons - by Barrowman - May-12-2018, 03:38 PM
RE: Problem with buttons - by woooee - May-12-2018, 04:41 PM
RE: Problem with buttons - by Larz60+ - May-12-2018, 06:05 PM
RE: Problem with buttons - by Barrowman - May-12-2018, 09:23 PM
RE: Problem with buttons - by Larz60+ - May-12-2018, 11:28 PM
|
Users browsing this thread: 2 Guest(s)