3

Same code generates GUI in mac (top) and Linux (bottom)

I am about to distribute the code using anaconda 2.7. I developed all the code in macOSX 10.10.3 64 bit machine. The GUI window looks natural in macOS, see the top figure. However, when I run the same code in Linux (Ubuntu 14, 64 bit), it appears very ugly. I checked Tkinter and ttk version in both platforms, and they are the same. i.e. Revision 81008 for Tkinter, 0.3.1 for ttk. The python version is the same too 2.7.14. These should be the same as I installed the same anaconda 2.7 distribution.

I saw this post Tkinter look (theme) in Linux. First of all the GUI doesn't look as bad as mine in Linux. Secondly, I tried varying ttk.Style() using root.style.theme_use("clam") but nothing happens. I tried also changing the font style, nothing happened either.

I would appreciate any helps and suggestions.

Chenyang
  • 161
  • 1
  • 11

1 Answers1

3

It can be related to this conda issue: https://github.com/ContinuumIO/anaconda-issues/issues/6833

TL;DR Anaconda doesn't include Freetype support in Tk DLL.

possible solution: (from https://stackoverflow.com/a/47787749/9968316)

$ mv lib/anaconda3/lib/libtk8.6.so lib/anaconda3/lib/libtk8.6.sav
$ ln -s /usr/lib/x86_64-linux-gnu/libtk8.6.so lib/anaconda3/lib/libtk8.6.so
karla
  • 369
  • 2
  • 8