|
From: <ai...@us...> - 2013-11-16 01:36:54
|
Revision: 12704
http://sourceforge.net/p/plplot/code/12704
Author: airwin
Date: 2013-11-16 01:36:52 +0000 (Sat, 16 Nov 2013)
Log Message:
-----------
Replace horrible hack with searching for substrings in $argv0 to decide
if tkdemos.tcl was being sourced from a plserver or wish environment.
Tested by Alan W. Irwin <ai...@us...> on Linux using
the test_tk_standard_examples and test_wish_standard_examples targets.
Note, the second target had a segfault right after example 33 completed
so investigation of that issue is ongoing.
Since the horrible hack is gone, there is a reasonable chance now that
these two targets (and also the test_interactive target which depends
on them) will also work fine in the installed examples tree. But that
case has not been tested yet.
Modified Paths:
--------------
trunk/examples/CMakeLists.txt
trunk/examples/tk/CMakeLists.txt
trunk/examples/tk/tkdemos.tcl
Modified: trunk/examples/CMakeLists.txt
===================================================================
--- trunk/examples/CMakeLists.txt 2013-11-16 01:07:16 UTC (rev 12703)
+++ trunk/examples/CMakeLists.txt 2013-11-16 01:36:52 UTC (rev 12704)
@@ -983,21 +983,21 @@
list(APPEND targets_examples_tk test_tk_standard_examples)
add_custom_target(test_wish_standard_examples
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tk/wish_standard_examples
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tk/wish_standard_examples -geometry 800x600
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tk
)
add_dependencies(test_wish_standard_examples
plplottcltk${LIB_TAG}
tk
- # FIXME, the tkwin dependency is part of the horrible hack to
- # allow tkdemos.tcl to distinguish between the plserver and wish
- # environments.
- tkwin
+ xwin
tcl_examples
tclIndex_tcl
tclIndex_tk
tclIndex_examples_tk
)
+ if(FILE_DEPENDS_xwin)
+ add_dependencies(test_wish_standard_examples test_xwin_dyndriver)
+ endif(FILE_DEPENDS_xwin)
list(APPEND targets_examples_tk test_wish_standard_examples)
if(ENABLE_itk)
Modified: trunk/examples/tk/CMakeLists.txt
===================================================================
--- trunk/examples/tk/CMakeLists.txt 2013-11-16 01:07:16 UTC (rev 12703)
+++ trunk/examples/tk/CMakeLists.txt 2013-11-16 01:36:52 UTC (rev 12704)
@@ -185,11 +185,9 @@
# wish_standard_examples is a configured shell script that runs all
# the standard examples under wish using a TEA-based approach.
# pkgIndex_LOCATION is the directory where the relevant pkgIndex.tcl
- # file is located. FIXME! use two directories temporarily as
- # part of the horrible hack currently allowing tkdemos to distinguish
- # between the plserver and wish environments.
+ # file is located.
if(CORE_BUILD)
- set(pkgIndex_LOCATION "${CMAKE_BINARY_DIR}/bindings/tk-x-plat ${CMAKE_BINARY_DIR}/bindings/tk")
+ set(pkgIndex_LOCATION ${CMAKE_BINARY_DIR}/bindings/tk)
else(CORE_BUILD)
set(pkgIndex_LOCATION ${DATA_DIR})
endif(CORE_BUILD)
Modified: trunk/examples/tk/tkdemos.tcl
===================================================================
--- trunk/examples/tk/tkdemos.tcl 2013-11-16 01:07:16 UTC (rev 12703)
+++ trunk/examples/tk/tkdemos.tcl 2013-11-16 01:36:52 UTC (rev 12704)
@@ -42,17 +42,25 @@
set utf8_examples {4 18 24 26 33}
-# 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}]} {
+# In order to distinguish whether this is a plserver or wish
+# environment we assume that $argv0 has the string "plserver" or
+# "wish" in it. Some contrived examples can be figured out where this
+# assumption is not correct, and for those cases we simply emit an
+# error message and return. But normally this assumption is correct,
+# and it is certainly correct for our tests.
+if { [string first "plserver" $argv0] >= 0 } {
# use 'plserver' method
plstdwin .
plxframe .plw
set plwin .plw.plwin
-} else {
+} elseif { [string first "wish" $argv0] >= 0 } {
+ # use 'wish" method
plframe .plw
set plwin .plw
+} else {
+ puts stderr "Error: argv0 = \"$argv0\"\ndoes not contain either the substrings \"plserver\" or \"wish\""
+ puts stderr "Therefore cannot decide how to proceed with tkdemos.tcl so giving up"
+ return
}
pack append . .plw {left expand fill}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|