aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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