aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlecoanet2004-09-24 12:51:11 +0000
committerlecoanet2004-09-24 12:51:11 +0000
commitd8fb263c68f6fb1b0c6af283dd78c88a2a813336 (patch)
treef11c368b746e95fd7be69e999e6a079285fa9d67
parentb41c0a70bd7349638f68b65419e28669f227b62a (diff)
downloadtkzinc-d8fb263c68f6fb1b0c6af283dd78c88a2a813336.zip
tkzinc-d8fb263c68f6fb1b0c6af283dd78c88a2a813336.tar.gz
tkzinc-d8fb263c68f6fb1b0c6af283dd78c88a2a813336.tar.bz2
tkzinc-d8fb263c68f6fb1b0c6af283dd78c88a2a813336.tar.xz
The demos path is managed locally by the demosPath proc
-rw-r--r--demos/zinc-widget19
1 files changed, 16 insertions, 3 deletions
diff --git a/demos/zinc-widget b/demos/zinc-widget
index 1ff1f05..9132771 100644
--- a/demos/zinc-widget
+++ b/demos/zinc-widget
@@ -201,6 +201,21 @@ proc showVars {w args} {
pack $w.ok -side bottom -pady 2
}
+#
+# demosPath --
+# Return the path to the installed demo directory.
+
+proc demosPath {} {
+ global zinc_library tcl_platform
+
+ if { [lindex $tcl_platform(os) 0] eq "Windows" &&
+ ! [file exists [file join $zinc_library pkgIndex.tcl]] } {
+ return [file join $zinc_library demos Tkzinc]
+ } {
+ return [file join $zinc_library demos]
+ }
+}
+
# invoke --
# This procedure is called when the user clicks on a demo description.
# It is responsible for invoking the demonstration.
@@ -209,8 +224,6 @@ proc showVars {w args} {
# index - The index of the character that the user clicked on.
proc invoke index {
- global zinc_library
-
set tags [.t tag names $index]
set i [lsearch -glob $tags demo-*]
if {$i < 0} {
@@ -220,7 +233,7 @@ proc invoke index {
.t configure -cursor watch
update
set demo [string range [lindex $tags $i] 5 end]
- uplevel [list source [file join $zinc_library demos $demo.tcl]]
+ uplevel [list source [file join [demosPath] $demo.tcl]]
update
.t configure -cursor $cursor