Skip to content
Advertisement

Tkinter look (theme) in Linux

I know that Tkinter is not so modern, not so cool and maybe better to use PyQt or etc.

But it is interesting for me can Tkinter look not so ugly in Ubuntu (Linux). Looks that brew version (in OS X) of python’s Tkinter compiled with built-in theme and looks good:

Mac OS X Tkinter

But Ubuntu’s Tkinter makes me cry:

Ubuntu Tkinter

I’ve read that for good theme I need to use ttk, but I dont know exactly how. My code looks as follow:

JavaScript

How to apply standard ubuntu theme or at least better theme?

Thanks.

Advertisement

Answer

All available themes of ttk can be seen with such commands:

JavaScript

So you can use ‘clam’, ‘alt’, ‘default’, ‘classic’ themes with your version of Tkinter.

After trying all of them I think the best one is ‘clam’. You can use this one or any other in following way:

JavaScript

Result:

enter image description here

OS X uses precompiled theme “aqua” so widgets are looking better.

Also Ttk widgets do not support all option which pure Tkinter does.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement