What am I doing wrong?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

What am I doing wrong?

Tom Turkey
When I run filerunner I want only the shipped code so the first thing I
do (i.e. first lines of code in the script)  is:

# This bit removes any special local dirs from auto_path. This is done
mostly
# to prevent shipping a filerunner that depends on local files...And so
we get
# the right code when debugging. MUST BE BEFORE FIRST PROC.
if {[info exists env(TCLLIBPATH)] } {
   foreach path $env(TCLLIBPATH) {
     set indx [lsearch -exact $auto_path $path]
     if {$indx != -1} {
       set auto_path [lreplace $auto_path $indx $indx]
       # puts "removed $path from auto_path"
     }
   }
   # Now clear any auto_index entries added from TCLLIBPATH
   auto_reset
}

The "auto_reset" here seems to be a problem on Windows systems (all is
fine on Linux). During initial load I get this error report:

Operating System :
Tcl/Tk version   : 8.6.3 / 8.6.3
Comments         :

Error string : Duplicate element ComboboxPopdownFrame.border

Stack trace follows:
--------------------
Duplicate element ComboboxPopdownFrame.border
     while executing
"ttk::style element create ComboboxPopdownFrame.border from default"
     invoked from within
"ttk::style theme settings winnative {

     ttk::style configure "."  -background SystemButtonFace -foreground
SystemWindowText  -selectforeground System..."
     (in namespace eval "::ttk::theme::winnative" script line 2)
     invoked from within
"namespace eval ttk::theme::winnative {
     ttk::style theme settings winnative {

     ttk::style configure "." \
         -background SystemButtonFace \
        ..."
     (file "/tk8.6/ttk/winTheme.tcl" line 5)
     invoked from within
"source /tk8.6/ttk/winTheme.tcl"
     ("uplevel" body line 1)
     invoked from within
"uplevel #0 [list source [file join $library $script]]"
     (procedure "ttk::LoadThemes" line 18)
     invoked from within
"ttk::LoadThemes"
     (file "/tk8.6/ttk/ttk.tcl" line 144)
     invoked from within
"source /tk8.6/ttk/ttk.tcl"
     ("uplevel" body line 1)
     invoked from within
"uplevel \#0 [list source $::ttk::library/ttk.tcl]"
     (file "/tk8.6/tk.tcl" line 692)
     invoked from within
"source /tk8.6/tk.tcl"
     (in namespace eval "::" script line 1)
     invoked from within
"namespace eval :: $auto_index($name)"
     (procedure "auto_load" line 13)
     invoked from within
"auto_load $name [uplevel 1 {::namespace current}]"
     (autoloading "::tk::ScreenChanged")
     (procedure "::unknown" line 22)
     invoked from within
"::tk::ScreenChanged :0.0"
     (changing screen in event binding)

Again: Removing the "auto_reset" makes the problem go away.

It only happens on Windows systems.

A few questions:

This looks like a bug to me. Is it?

Do I really need "auto_reset" to accomplish the intended objective or is
removing the paths in env(TCLLIBPATH) sufficient? (As long as stuff in
env(TCLLIBPATH) is not 'replacing' any system commands, I would think it
is not needed. Right?)

If I remove it, could the user do something in his TCLLIBPATH that could
trip up the code. I.e. is a "tclIndex" file loaded from his library
still active if I don't do the "auto_reset"?

Among the tclIndex files, if there is a duplicate for a given proc which
one wins:

The first one pointed to by "auto_path"? Even after "auto_path" is sorted?

Or are these loaded during start up, prior to my first code, thus fixing
the load order?

There must be a simple way to be immune from anything a user might do here.

--
Filerunner @ http://sourceforge.net/projects/filerunner/files/  by
Tom Turkey [hidden email]


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Tcl-Core mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tcl-core
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What am I doing wrong?

Donald Porter

> On Jun 13, 2017, at 5:20 PM, Tom Turkey <[hidden email]> wrote:

> Tcl/Tk version   : 8.6.3 / 8.6.3

Those releases are out of date and known to be broken
with serious I/O troubles.  You waste everyone’s time, most
importantly your own, trying to use them.

Supported release is Tcl/Tk 8.6.6. Don’t bother us about
anything else.

DGP



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Tcl-Core mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tcl-core
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What am I doing wrong?

Tom Turkey
On 06/13/17 18:21, Donald Porter wrote:

>
>> On Jun 13, 2017, at 5:20 PM, Tom Turkey <[hidden email]> wrote:
>
>> Tcl/Tk version   : 8.6.3 / 8.6.3
>
> Those releases are out of date and known to be broken
> with serious I/O troubles.  You waste everyone’s time, most
> importantly your own, trying to use them.
>
> Supported release is Tcl/Tk 8.6.6. Don’t bother us about
> anything else.

Thank you so much for you kind consideration.
In this case I find myself constrained by the usage of freewrap, so as
not to require the user to have tcl/tk on her/his system.

I am also concerned with the central issue of preventing local
definitions of 'env(TCLLIBPATH)' from adversely affecting the product.
While I would not expect this to affect the freewrap versions of my
product, it could certainly adversely affect *nix versions.

I think 'auto_reset' is rather like using a wrecking ball where a tack
hammer is needed. It would be 'nice' to have a command that would take
a path and remove it from auto_path while also undoing any tclIndex
entries found in auto_index.  It would even be nicer if, through the
magic of trace, the auto_index was cleaned up if any path was removed
from auto_path.

In any case, thanks for your response.

--
Filerunner @ http://sourceforge.net/projects/filerunner/files/  by
Tom Turkey [hidden email]


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Tcl-Core mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tcl-core
Loading...