Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: changing background color of a button
Post: RE: changing background color of a button

Thanks. I created a list of buttons as you suggested. buttons = []then I add each button to that list buttons.append(aButton)But, buttons[i]['bg'] = 'red' does not work. What is the correct syntax t...
ieee488 GUI 2 4,222 Sep-06-2019, 01:24 PM
    Thread: changing background color of a button
Post: changing background color of a button

I am a beginner to Python but not to programming in general. I have the following code for creating 3 buttons: for i in range(1, 3): aButton = "button" + str(i) aButton = tkinter.Button(Gui, ...
ieee488 GUI 2 4,222 Sep-06-2019, 11:52 AM
    Thread: change background color of button
Post: RE: change background color of button

Thank you both. I ended up with def setBG(button): if button['bg'] == 'white': button['bg'] = 'yellow' button['activebackground'] = 'yellow' else: button['bg'] = 'whit...
ieee488 GUI 3 9,961 Jul-30-2019, 09:49 PM
    Thread: change background color of button
Post: change background color of button

Starting to learn Python though I know other languages such as VB.NET I create 5 buttons. tkinter.Button(Gui, "1", command=callback).grid(row=0, column=1) ... tkinter.Button(Gui, "5", command=callba...
ieee488 GUI 3 9,961 Jul-27-2019, 11:21 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020