Menu

#138 Make PLplot work correctly with modern Itcl, Itk, and Iwidgets

open
None
5
2015-01-28
2014-01-16
No

The -DUSE_INCRTCL_VERSION_4=ON option forces the PLplot build system to look for and use version 4 of Itcl and Itk and version 4.1 of Iwidgets (referred to hereafter as "modern" Itcl and friends). However, PLplot has some issues with modern Itcl and friends that do not occur for version 3 of Itcl and Itk and version 4.0 of Iwidgets (referred to hereafter as "old" Itcl and friends) that are found and used by default, i.e., when -DUSE_INCRTCL_VERSION_4 is not specified or set to OFF.

These PLplot issues with modern Itcl and friends are the following:

  • Run-time errors with the Iwidgets file chooser.

For -dev tk one can access that file chooser by clicking on "Plot->save->as". The result is an error message that starts as

cannot inherit from "iwidgets::Dialog" (cannot inherit from
"iwidgets::Dialogshell" (cannot inherit from "iwidgets::Shell" (cannot
inherit from "itk::Toplevel" (can't create object "itk::Toplevel":
command already exists with that nameITCL: cannot create
Tcl_NewObjectInstance for class "::itk::Toplevel"))))
....

There is also the same message for -dev tk if you click on Plot->Palettes->Palette 0 and Plot->Palettes->Palette 1 and attempt to "Save Palette" or "Load Palette". I assume that is because those buttons also attempt to run the Iwidgets file chooser.

Note that modern Itcl and friends work well otherwise for the colour palette case; I was able to demonstrate (with the exception of "Save Palette" and "Load Palette") that all the many different colour palette sliders and buttons work in detail for both the Palette 0 and 1 cases just like they do for old Itcl and friends.

  • Run-time issues with the test_tk_02 target.

software@raven> make test_tk_02
[ 0%] Built target tclmatrixd
[ 0%] Built target plhershey-unicode-gen
[ 4%] Built target plhershey-unicode.h_built
[ 4%] Built target csirocsa
[ 12%] Built target csironn
[ 16%] Built target deltaT-gen
[ 16%] Built target deltaT.h_built
[ 20%] Built target tai-utc-gen
[ 20%] Built target tai-utc.h_built
[ 20%] Built target qsastime
[ 52%] Built target plplotd
[ 60%] Built target plplottcltkd
[ 60%] Built target xtk02
[ 60%] Built target plplot.tcl_target
[ 60%] Built target tclIndex_tcl
[ 76%] Built target tcl_files
[ 92%] Built target tclIndex_tk
[ 96%] Built target xwin
[ 96%] Built target test-drv-info
[100%] Built target test_xwin_dyndriver
cannot inherit from "PLWin" (cannot inherit from "itk::Widget" (can't create object "itk::Widget": command already exists with that nameITCL: cannot create Tcl_NewObjectInstance for class "::itk::Widget"))
while executing
"inherit PLWin"
(class "Pltkwin" body line 2)
invoked from within
"itcl::class Pltkwin {
inherit PLWin

 constructor {args} {}
 protected method plwin {} { return $itk_interior.plwin }

 public method..."
 (file "/home/software/plplot_svn/HEAD/build_dir/bindings/tk/Pltkwin.tcl" line 41)
 invoked from within

"source /home/software/plplot_svn/HEAD/build_dir/bindings/tk/Pltkwin.tcl"
(in namespace eval "::" script line 1)
invoked from within
"namespace eval :: $auto_index($name)"
(procedure "auto_load" line 13)
invoked from within
"auto_load $name [uplevel 1 {::namespace current}]"
(autoloading "Pltkwin")
(procedure "::unknown" line 22)
invoked from within
"Pltkwin .plw"
(file "/home/software/plplot_svn/HEAD/build_dir/examples/tk/tk02" line 49)
invoked from within
"source /home/software/plplot_svn/HEAD/build_dir/examples/tk/tk02"
make[3]: [examples/CMakeFiles/test_tk_02] Error 1
make[2]:
[examples/CMakeFiles/test_tk_02.dir/all] Error 2
make[1]: [examples/CMakeFiles/test_tk_02.dir/rule] Error 2
make:
[test_tk_02] Error 2

  • Run-time issues with the test_tk_04 target.

software@raven> make test_tk_04
[ 0%] Built target tclmatrixd
[ 0%] Built target plhershey-unicode-gen
[ 4%] Built target plhershey-unicode.h_built
[ 4%] Built target csirocsa
[ 12%] Built target csironn
[ 16%] Built target deltaT-gen
[ 16%] Built target deltaT.h_built
[ 20%] Built target tai-utc-gen
[ 20%] Built target tai-utc.h_built
[ 20%] Built target qsastime
[ 52%] Built target plplotd
[ 60%] Built target plplottcltkd
Scanning dependencies of target xtk04
[ 60%] Building C object examples/tk/CMakeFiles/xtk04.dir/xtk04.c.o
Linking C executable xtk04
[ 60%] Built target xtk04
[ 60%] Built target plplot.tcl_target
[ 60%] Built target tclIndex_tcl
[ 76%] Built target tcl_files
[ 92%] Built target tclIndex_tk
[ 96%] Built target xwin
[ 96%] Built target test-drv-info
[100%] Built target test_xwin_dyndriver
Scanning dependencies of target test_tk_04
cannot inherit from "PLWin" (cannot inherit from "itk::Widget" (can't create object "itk::Widget": command already exists with that nameITCL: cannot create Tcl_NewObjectInstance for class "::itk::Widget"))
while executing
"inherit PLWin"
(class "PLXWin" body line 2)
invoked from within
"itcl::class PLXWin {
inherit PLWin

 constructor {args} {
     eval PLWin::constructor $args
 } {
 # Set up defaults

     plw::setup_defaults $h..."
 (file "/home/software/plplot_svn/HEAD/build_dir/bindings/tk/PLXWin.itk" line 8)
 invoked from within

"source /home/software/plplot_svn/HEAD/build_dir/bindings/tk/PLXWin.itk"
(in namespace eval "::" script line 1)
invoked from within
"namespace eval :: $auto_index($name)"
(procedure "auto_load" line 13)
invoked from within
"auto_load $name [uplevel 1 {::namespace current}]"
(autoloading "PLXWin")
(procedure "::unknown" line 22)
invoked from within
"PLXWin .plw"
(file "/home/software/plplot_svn/HEAD/build_dir/examples/tk/tk04" line 37)
invoked from within
"source /home/software/plplot_svn/HEAD/build_dir/examples/tk/tk04"
make[3]: [examples/CMakeFiles/test_tk_04] Error 1
make[2]:
[examples/CMakeFiles/test_tk_04.dir/all] Error 2
make[1]: [examples/CMakeFiles/test_tk_04.dir/rule] Error 2
make:
[test_tk_04] Error 2

All the three error messages above contain the strings "cannot inherit from" and "command already exists with that" and a google search for the AND of those two strings found http://sourceforge.net/p/incrtcl/bugs/182/. I didn't understand that discussion much (note I don't understand OO concepts that well) except that the incrtcl (i.e., modern Itcl and Itk) developers didn't view the issue as a bug. But if you understand that discussion it may lead to an easy solution for what changes we have to make so that PLplot becomes completely compatible with modern Itcl and friends.

Note, I don't think the required PLplot changes will need to be large because most of the colour palette already works fine with modern Itcl and friends (see above). Furthermore, that good result is consistent with the extremely small set of differences between Iwidgets-4.0.1 and Iwidgets-4.1.0 which can be seen in cmake/epa_build/iwidgets/iwidgets4.1.patch. This small set of changes allows Iwidgets-4.1.0 to work with modern Itcl and Itk as well as Iwidgets-4.0.1 works with old Itcl and Itk. (I have demonstrated that by trying the old Iwidgets calendar and watch demos in both cases with no issues.)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.