0

In tkinter you can choose a background for text widget, or background for toplevel widget(children windows)....etc, but is there any way to set a whole background for the whole gui application(set a background for all widgets at once with same color), instead of picking each background for each widget?

ghazigamer
  • 100
  • 9
  • I think you are looking for `option_add`, see https://stackoverflow.com/a/23832457/13629335 – Thingamabobs Aug 29 '20 at 16:45
  • @Atlas435 before i submit this question as "already answered", i still dont understand how option_add work, because when i do it, the background for text widget for example doesnt change. – ghazigamer Aug 29 '20 at 17:23
  • You could use `ttk` which is themed, but dont go for customizing it, its tiresome, use the default skins, its fun – Delrius Euphoria Aug 29 '20 at 18:33
  • @ghazigamer You need to put the `option_add` lines before creating the widgets, they don't apply to already existing widgets. – j_4321 Aug 29 '20 at 18:39
  • @CoolCloud ttk also work the same (i have to set a background for each widget) unless i am mistaken? – ghazigamer Aug 29 '20 at 18:52
  • @ghazigamer You can change the background of all ttk widgets with `style.configure('.', background='black')` – j_4321 Aug 31 '20 at 06:55

0 Answers0