|
From: <ai...@us...> - 2013-11-05 20:25:14
|
Revision: 12663
http://sourceforge.net/p/plplot/code/12663
Author: airwin
Date: 2013-11-05 20:25:06 +0000 (Tue, 05 Nov 2013)
Log Message:
-----------
Make tkdemos.tcl work under wish.
Caveats:
(1) The logic for deducing whether tkdemos.tcl is
sourced under plserver or wish is pretty shaky and needs
replacing by a better method.
(2) The constants available from libplotd
are not available for unknown reasons under wish (since
the libplplot library should automatically be loaded by
package require Pltk). So examples 10 and 12 work (since
they do not require library constants), but many other
examples (e.g., 1 and 2) do not currently work because
of this issue.
Modified Paths:
--------------
trunk/examples/tk/README.tkdemos
trunk/examples/tk/tkdemos.tcl
Modified: trunk/examples/tk/README.tkdemos
===================================================================
--- trunk/examples/tk/README.tkdemos 2013-11-05 16:36:59 UTC (rev 12662)
+++ trunk/examples/tk/README.tkdemos 2013-11-05 20:25:06 UTC (rev 12663)
@@ -20,10 +20,19 @@
# from "plserver" to "../../bindings/plserver"
./xtk04 -f tk04
-There are two ways to run tkdemos.tcl which exercises all the x??.tcl
+There are two ways to run the examples below, where the alternatives
+are indicated by "|". The first alternative should only be used if
+you have changed directories to
+$prefix/share/plplot$VERSION/examples/tk where $prefix is the PLplot
+install prefix and $VERSION is the PLplot release version, e.g.,
+5.9.10. (That is, the first alternative should be used if you have
+changed directories to the installed tk examples directory.) The
+second alternative should only be used if you have changed directories
+to bindings/examples/tk in the build tree.
+
+(1) Run tkdemos.tcl from plserver. This potentially exercises all the x??.tcl
examples using the plframe widget:
-(1)
plserver | ../../bindings/tk/plserver
source tkdemos.tcl
1
@@ -33,33 +42,40 @@
Note the plserver command has normal PLplot command-line options (run
plserver -h to find out what they are).
-(2) Note, fill in $prefix below with whatever you configured for the install
-prefix (/usr/local/plplot or whatever) and $VERSION with the plplot VERSION
-you are running at this time (5.2.0 or whatever).
+(2) Run tkdemos.tcl from wish.
-wish
-lappend auto_path $prefix/share/plplot$VERSION | ../../bindings/tk
+wish -geometry 600x400
+lappend auto_path $prefix/share/plplot$VERSION ../../bindings/tk-x-plat ../../bindings/tk
package require Pltk
source tkdemos.tcl
1
2
....
+FIXME: Note the ../../bindings/tk-x-plat in auto_path is a temporary
+measure to support the hacked tkdemos.tcl logic which invokes package
+require Plplotter to distinguish between the plserver case (where that
+package is not available) and the current wish case (where that
+package can be successfully loaded because of ../../bindings/tk-x-plat
+in auto_path).
+
+FIXME: Try examples 10 and 12 which should work. Most of the rest
+(e.g., 1, 2,) currently do not work because PLplot library constants
+are not available under wish for some unknown reason.
+
To find out more about the wish command (which comes as part of the Tk
package) use man wish.
Both the plserver and wish methods execute the various x??.tcl examples
-corresponding to the numbers specified by the user. A few of the x??.tcl
-examples will return the message that they have not been implemented, but
-the rest should work smoothly without problems.
+corresponding to the numbers specified by the user.
+(3) Run runAllDemos.tcl from plserver.
-runAllDemos.tcl now works both under plserver
-and wish
-
-plserver
+plserver | ../../bindings/tk/plserver
source runAllDemos.tcl
+(4) Run runAllDemos.tcl from wish.
+
wish
lappend auto_path $prefix/share/plplot$VERSION | ../../bindings/tk-x-plat ../../bindings/tk
package require Plplotter
Modified: trunk/examples/tk/tkdemos.tcl
===================================================================
--- trunk/examples/tk/tkdemos.tcl 2013-11-05 16:36:59 UTC (rev 12662)
+++ trunk/examples/tk/tkdemos.tcl 2013-11-05 20:25:06 UTC (rev 12663)
@@ -42,8 +42,18 @@
set utf8_examples {4 18 24 26 33}
-plstdwin .
-plxframe .plw
+# This is hacked logic for distinguishing between the plserver
+# and wish cases which requires an extra directory be lappended in
+# the build tree for the Pltk case. FIXME.
+if {[catch {package require Plplotter}]} {
+ # use 'plserver' method
+ plstdwin .
+ plxframe .plw
+ set plwin .plw.plwin
+} else {
+ plframe .plw
+ set plwin .plw
+}
pack append . .plw {left expand fill}
for {set i 0} {$i <= 33} {incr i} {
@@ -62,13 +72,14 @@
}
proc $i {} "
- .plw.plwin cmd plspause 0
- $demo .plw.plwin
- .plw.plwin cmd plcol0 1
- .plw.plwin cmd plsori 0
- .plw.plwin cmd plspal0 cmap0_default.pal
- .plw.plwin cmd plspal1 cmap1_default.pal 1
- .plw.plwin cmd plstransform NULL
+ global plwin
+ $plwin cmd plspause 0
+ $demo $plwin
+ $plwin cmd plcol0 1
+ $plwin cmd plsori 0
+ $plwin cmd plspal0 cmap0_default.pal
+ $plwin cmd plspal1 cmap1_default.pal 1
+ $plwin cmd plstransform NULL
"
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|