Some ttk styles not accessible from within python script
Question: I am trying to use a ttk style for my Tkinter gui.

When I run on the command line

    
    
    >>> from ttk import *
    >>> print Style().theme_names()
    ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')
    

which appears fine, as I want the `vista` style. However, when running a
script with the following lines:

    
    
    from ttk import *
    print Style().theme_names()
    

the output is:

    
    
    ('clam', 'alt', 'default', 'classic')
    

and so when I try:

    
    
    from ttk import *
    Style().theme_use("vista")
    

I get:

    
    
    File "test.py", line 2, in <module>
      Style().theme_use("vista")
    File "/usr/lib/python2.7/lib-tk/ttk.py", line 534, in theme_use
      self.tk.call("ttk::setTheme", themename)
    _tkinter.TclError: can't find package ttk::theme::vista
    

Not sure what it could be and I've not had much luck googling.

I'm running from within Console2 under cygwin if that makes any difference.

Thanks!


Answer: Some of the ttk themes are supported on only one platform. xpnative,
winnative, and vista, for example, only work on windows. The "aqua" theme only
works on OSX. The others, I think, run on any platform.

If you're running via cygwin, the version of python you're running was
probably configured differently at compile time so that it think it is running
on linux rather than windows. Therefore, it doesn't have access to windows
themes.

