| Store | Cart

[Tkinter-discuss] Detecting third-party ttk themes

From: Michael Lange <klap...@web.de>
Fri, 8 Mar 2013 23:27:25 +0100
Hi,

does any one know of a way to make ttk auto-detect third-party themes
(like the ones from the tile-themes project at
http://tktable.cvs.sourceforge.net/viewvc/tktable/tile-themes/ )?

Here I installed these (as I thought) properly on my system (debian
linux); "installed" means that I copied the whole tile-themes folder
to /usr/lib, and added a pkgIndex.tcl file that contains the following
two lines:

set themesdir [file join [pwd] [file dirname [info script]]]
lappend auto_path $themesdir

This works at least partially, but ttk now shows the following odd
behavior:

>>> import Tkinter, ttk>>> root = Tkinter.Tk()>>> s = ttk.Style()>>> s.theme_names()
('clam', 'alt', 'default', 'classic')
>>> root.tk.call('ttk::themes')
('classic', 'default', 'clam', 'alt')
>>> s.theme_use('winxpblue')>>> s.theme_names()
('clam', 'alt', 'default', 'winxpblue', 'classic')
>>> root.tk.call('ttk::themes')
('keramik', 'plastik', 'clam', 'winxpblue', 'alt', 'Aquativo', 'classic',
'default', 'keramik_alt')
>>> 

Apparently here ttk::themes works better than theme_names(), although for
some reason it is not in ttk.py, but both fail to find the extra themes
before one is loaded for the first time.

Has any one an idea, is there a way to change the pkgIndex.tcl file so
that ttk will find the themes automagically or isn't this possible at all?

Regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Sometimes a man will tell his bartender things he'll never tell his
doctor.
		-- Dr. Phillip Boyce, "The Menagerie" ("The Cage"),
		   stardate unknown.
_______________________________________________
Tkinter-discuss mailing list
Tkin...@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Recent Messages in this Thread
Michael Lange Mar 08, 2013 10:27 pm
Michael Lange Mar 10, 2013 02:15 pm
Jeff Epler Mar 11, 2013 01:55 am
Michael Lange Mar 11, 2013 06:30 pm
Messages in this thread