File scidthemes.0.9.3.zip contains a separate library.
I use '~/.tclshrc', which have a line:
lappend ::auto_path ~/tcl/lib/scidthemes-0.9.3
File '~/tcl/lib/scidthemes-0.9.3/pkgIndex.tcl' automatically load and execute code from file 'scidthemes.tcl'.
So, I have an error, when start tclsh:
error reading package index file /usr/lib64/scidthemes-0.9.3/pkgIndex.tcl: invalid command name "image"
This error can be resolved with next changes in 'pkgIndex.tcl' file:
--- a/pkgIndex.tcl 2018-08-22 16:06:34.000000000 +0300
+++ b/pkgIndex.tcl 2022-06-19 20:22:01.761586474 +0300
@@ -1,3 +1,3 @@
set themesdir [file join [pwd] [file dirname [info script]]]
-source [file join $themesdir scidthemes.tcl]
+package ifneeded scidthemes 0.9.3 [list source [file join $dir scidthemes.tcl]]
#option add *Menu.BorderWidth 0
Patch attached.
I prepare system and test patches.
Final versions of patches attached.
Patch 1:
Patch 2
With this patch, first line of pkgIndex.tcl - is not needs.
So, final version of pkgIndex.tcl file may be just in one line:
Thank you Bogdan. I'll check this
I checked the patch. It work for the tclsh, but it fails on new installations of SCID:
SCID does preload the themes, so they are not "needed". If no theme of
the packages is used then no themes are loaded and no theme is
available in the theme menu. The patch only works when the
theme is stored in option.dat and used on start of SCID.
Line:
register a command, which must be executed, when user call:
So, if user doesn't call "package require ", then themes from ttk::theme::scidthemes package does not to be loaded.
Original "pkgIndex.tcl" file have line:
which directly loads the scidthemes.tcl file when interpreter detect pkgIndex.tcl in the directories from ::auto_path variable. And this command does not provide an option for user - does he really needs this package.
Normal behaviour in general usage - is to load package by request.
So, if scidthemes with original pkgIndex.tcl file will be stored into the common libraries path (::auto_path), then each application, which starts from this environment - will load scidthemes library automatically, without request.
Of course, applications, which necessary need this package - may load it without request. But this is not a common behaviour, not universal mode.
May be problem with SCID is because SCID does not call "package require ttk::theme::scidthemes" at start?