Vidyalelo
Python · Q33

GUI Programming with Python

Programming · Python · question 33

Q33

How do you change the background color of a widget in Tkinter?

A.
background_color.set("NewColor")
B.
widget.bg_color("NewColor")
C.
widget.configure(bg="NewColor")
Answer
D.
widget.set_bg("NewColor")

Answer: Option C

Solution

Answer: Option C
Solution:
The widget.configure(bg="NewColor") method is used to change the background color of a widget in Tkinter.