Skip to content

TclTk 9 compat #4

@umlaeute

Description

@umlaeute

When running tkcon.tcl with TclTk-9.0 (released at the end of last 2024), i get an error:

wish9.0 tkcon.tcl 
Error in startup script: version conflict for package "Tk": have 9.0.0, need 8.4
    while executing
"package require Tk 8.4"
    invoked from within
"if {$tcl_version < 8.4} {
    return -code error "tkcon requires at least Tcl/Tk 8.4"
} else {
    package require Tk 8.4
}"
    (file "tkcon.tcl" line 57)

with Tcl>=8.5, one could use min-unbound versions (e.g. package require Tk 8.4-) but since this project obviously aims at compat with TclTk-8.4 this is not a good solution.

however, i think that there's no need to both check the $tcl_version and require versioned Tk package: afaik, you cannot really load a non-matching Tk-version into a given Tcl-interpreter (that is: if we know that the Tcl-interpreter is 8.27, then the only loadable Tk is also 8.27.

so I think that this would be sufficient:

From 55e4887f86475f2004c7f412fd98118c9d0cd944 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= <[email protected]>
Date: Tue, 21 Jan 2025 09:01:42 +0100
Subject: [PATCH] Drop versioned dependency on Tk>=8.4

So tkcon is usable with TclTk-9
---
 tkcon.tcl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tkcon.tcl b/tkcon.tcl
index a33397a..494779f 100755
--- a/tkcon.tcl
+++ b/tkcon.tcl
@@ -57,7 +57,7 @@ exec wish "$0" ${1+"$@"}
 if {$tcl_version < 8.4} {
     return -code error "tkcon requires at least Tcl/Tk 8.4"
 } else {
-    package require Tk 8.4
+    package require Tk
 }
 
 # We need to load some package to get what's available, and we
-- 
2.45.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions