From: <ai...@us...> - 2008-12-12 01:24:34
|
Revision: 9092 http://plplot.svn.sourceforge.net/plplot/?rev=9092&view=rev Author: airwin Date: 2008-12-12 01:24:30 +0000 (Fri, 12 Dec 2008) Log Message: ----------- Update to complete set of the current 30 standard examples. Modified Paths: -------------- trunk/examples/tk/CMakeLists.txt trunk/examples/tk/tkdemos.tcl Modified: trunk/examples/tk/CMakeLists.txt =================================================================== --- trunk/examples/tk/CMakeLists.txt 2008-12-11 23:47:35 UTC (rev 9091) +++ trunk/examples/tk/CMakeLists.txt 2008-12-12 01:24:30 UTC (rev 9092) @@ -21,104 +21,114 @@ set(tk_FILES) set(tk_SRC_FILES -README.tkdemos -runAllDemos.tcl -runExtendedDemos.tcl -tkdemos.tcl -) + README.tkdemos + runAllDemos.tcl + runExtendedDemos.tcl + tkdemos.tcl + ) set(tk_STRING_INDICES -"01" -"02" -"03" -"04" -"05" -"06" -"07" -"08" -"09" -"10" -"11" -"12" -"13" -"14" -"15" -"16" -"17" -"18" -"19" -"22" -) + "01" + "02" + "03" + "04" + "05" + "06" + "07" + "08" + "09" + "10" + "11" + "12" + "13" + "14" + "15" + "16" + "17" + "18" + "19" + "20" + "21" + "22" + "23" + "24" + "25" + "26" + "27" + "28" + "29" + "30" + ) # Copy files to the binary directory (if different) for generating tclIndex # This ensures no files are created in the source tree. if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") -foreach(_file ${tk_SRC_FILES}) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file} - COMMAND ${CMAKE_COMMAND} - -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/${_file} - ${CMAKE_CURRENT_BINARY_DIR}/${_file} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_file} - ) - set(tk_FILES ${tk_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${_file}) -endforeach(_file ${tk_SRC_FILES}) + foreach(_file ${tk_SRC_FILES}) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file} + COMMAND ${CMAKE_COMMAND} + -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/${_file} + ${CMAKE_CURRENT_BINARY_DIR}/${_file} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_file} + ) + set(tk_FILES ${tk_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${_file}) + endforeach(_file ${tk_SRC_FILES}) endif(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") foreach(STRING_INDEX ${tk_STRING_INDICES}) set(_file x${STRING_INDEX}.tcl) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file} - COMMAND ${CMAKE_COMMAND} - -E copy - ${CMAKE_SOURCE_DIR}/examples/tcl/${_file} - ${CMAKE_CURRENT_BINARY_DIR}/${_file} - DEPENDS ${CMAKE_SOURCE_DIR}/examples/tcl/${_file} - ) + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file} + COMMAND ${CMAKE_COMMAND} + -E copy + ${CMAKE_SOURCE_DIR}/examples/tcl/${_file} + ${CMAKE_CURRENT_BINARY_DIR}/${_file} + DEPENDS ${CMAKE_SOURCE_DIR}/examples/tcl/${_file} + ) set(tk_FILES ${tk_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${_file}) endforeach(STRING_INDEX ${tk_STRING_INDICES}) install(FILES ${tk_FILES} DESTINATION ${DATA_DIR}/examples/tk) add_custom_command( -OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex -COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} -DEPENDS ${tk_FILES} -WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tclIndex + COMMAND ${TCL_TCLSH} ${MKTCLINDEX} ${MKTCLINDEX_ARGS} + DEPENDS ${tk_FILES} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tclIndex DESTINATION ${DATA_DIR}/examples/tk) set(tk_SCRIPTS -tk01 -tk02 -tk03 -tk04 -) + tk01 + tk02 + tk03 + tk04 + ) install(PROGRAMS ${tk_SCRIPTS} DESTINATION ${DATA_DIR}/examples/tk) set(tk_SRC -xtk01.c -xtk02.c -xtk04.c -) + xtk01.c + xtk02.c + xtk04.c + ) install(FILES ${tk_SRC} DESTINATION ${DATA_DIR}/examples/tk) set(CC ${CMAKE_C_COMPILER}) configure_file( -${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in -${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples -) + ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in + ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples + ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples -DESTINATION ${DATA_DIR}/examples/tk -RENAME Makefile -) + DESTINATION ${DATA_DIR}/examples/tk + RENAME Makefile + ) add_custom_target(tclIndex_examples_tk ALL DEPENDS ${tk_FILES} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex -) + ) Modified: trunk/examples/tk/tkdemos.tcl =================================================================== --- trunk/examples/tk/tkdemos.tcl 2008-12-11 23:47:35 UTC (rev 9091) +++ trunk/examples/tk/tkdemos.tcl 2008-12-12 01:24:30 UTC (rev 9092) @@ -21,7 +21,7 @@ plxframe .plw pack append . .plw {left expand fill} -for {set i 1} {$i <= 19} {incr i} { +for {set i 1} {$i <= 30} {incr i} { set demo x[format "%02d" $i] source $demo.tcl proc $i {} "$demo .plw.plwin" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-03-03 02:13:41
|
Revision: 10838 http://plplot.svn.sourceforge.net/plplot/?rev=10838&view=rev Author: airwin Date: 2010-03-03 02:13:34 +0000 (Wed, 03 Mar 2010) Log Message: ----------- Change over to configured form of the tk01, tk02, tk03, and tk04 scripts. This allows clean separation of build-tree and install-tree location of xtk01 (invoked by tk01), xtk02 (invoked by tk02), plserver (invoked by tk03), and xtk04 (invoked by tk04). Modified Paths: -------------- trunk/examples/tk/CMakeLists.txt Added Paths: ----------- trunk/examples/tk/tk01.in trunk/examples/tk/tk02.in trunk/examples/tk/tk03.in trunk/examples/tk/tk04.in Removed Paths: ------------- trunk/examples/tk/tk01 trunk/examples/tk/tk02 trunk/examples/tk/tk03 trunk/examples/tk/tk04 Modified: trunk/examples/tk/CMakeLists.txt =================================================================== --- trunk/examples/tk/CMakeLists.txt 2010-03-01 20:52:41 UTC (rev 10837) +++ trunk/examples/tk/CMakeLists.txt 2010-03-03 02:13:34 UTC (rev 10838) @@ -62,10 +62,6 @@ runAllDemos.tcl runExtendedDemos.tcl tkdemos.tcl - tk01 - tk02 - tk03 - tk04 ) # Copy files to the binary directory (if different) for generating tclIndex @@ -123,40 +119,14 @@ DEPENDS ${tk_FILES} ${CMAKE_CURRENT_BINARY_DIR}/tclIndex ) +# The third example is run using a configured shell script which invokes +# plserver so there is no source code to be compiled. +set(tk_SRC xtk01.c) # The second and fourth Tk examples depend on Itk to work. -set(tk_SCRIPTS tk01 tk03) -set(tk_SRC xtk01.c) - if(ENABLE_itk) - list(APPEND tk_SCRIPTS tk02 tk04) list(APPEND tk_SRC xtk02.c xtk04.c) endif(ENABLE_itk) -if(CORE_BUILD) - install(FILES ${tk_FILES} DESTINATION ${DATA_DIR}/examples/tk) - - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tclIndex DESTINATION ${DATA_DIR}/examples/tk) - - install(PROGRAMS ${tk_SCRIPTS} DESTINATION ${DATA_DIR}/examples/tk) - install(FILES ${tk_SRC} DESTINATION ${DATA_DIR}/examples/tk) - - set(CC ${CMAKE_C_COMPILER}) - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in - ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples - ) - - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples - DESTINATION ${DATA_DIR}/examples/tk - RENAME Makefile - ) - - install(FILES CMakeLists.txt - DESTINATION ${DATA_DIR}/examples/tk - ) -endif(CORE_BUILD) - if(BUILD_TEST) if(CORE_BUILD) include_directories( @@ -188,3 +158,64 @@ endforeach(TK_SRC_FILE ${tk_SRC}) set_property(GLOBAL APPEND PROPERTY TARGETS_examples_tk tclIndex_examples_tk) endif(BUILD_TEST) + +# The first, second, and fourth tk examples depend on configured bang +# scripts to work which depends directly on the executables, xtk01, +# xtk02, and xtk04. +# The third example is run with the configured shell script, tk03, which +# invokes plserver. +set(tk_SCRIPTS tk01.in tk03.in) +get_target_property(xtk01_LOCATION xtk01 LOCATION) +get_target_property(plserver_LOCATION plserver LOCATION) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/tk01.in + ${CMAKE_CURRENT_BINARY_DIR}/tk01 + @ONLY +) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/tk03.in + ${CMAKE_CURRENT_BINARY_DIR}/tk03 + @ONLY +) +# The second and fourth Tk examples depend on Itk to work. +if(ENABLE_itk) + list(APPEND tk_SCRIPTS tk02.in tk04.in) + get_target_property(xtk02_LOCATION xtk02 LOCATION) + get_target_property(xtk04_LOCATION xtk04 LOCATION) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/tk02.in + ${CMAKE_CURRENT_BINARY_DIR}/tk02 + @ONLY + ) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/tk04.in + ${CMAKE_CURRENT_BINARY_DIR}/tk04 + @ONLY + ) +endif(ENABLE_itk) + +if(CORE_BUILD) + install(PROGRAMS ${tk_SCRIPTS} DESTINATION ${DATA_DIR}/examples/tk) + install(FILES ${tk_FILES} DESTINATION ${DATA_DIR}/examples/tk) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tclIndex DESTINATION ${DATA_DIR}/examples/tk) + + install(FILES ${tk_SRC} DESTINATION ${DATA_DIR}/examples/tk) + + set(CC ${CMAKE_C_COMPILER}) + + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in + ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples + ) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples + DESTINATION ${DATA_DIR}/examples/tk + RENAME Makefile + ) + + install(FILES CMakeLists.txt + DESTINATION ${DATA_DIR}/examples/tk + ) +endif(CORE_BUILD) Deleted: trunk/examples/tk/tk01 =================================================================== --- trunk/examples/tk/tk01 2010-03-01 20:52:41 UTC (rev 10837) +++ trunk/examples/tk/tk01 2010-03-03 02:13:34 UTC (rev 10838) @@ -1,130 +0,0 @@ -#!xtk01 -f -# -*-tcl-*- -# $Id$ -# -# Geoffrey Furnish -# 11 April 1994 -# -# @> A script for using Tk to control xtk01 -############################################################################### - -wm title . "x01c -- TK version" -plstdwin . - -# If you just want a bare plframe, set this to 0. - -set use_plxframe 1 - -if { $use_plxframe == 1 } then { - set plwin .plw.plwin -} else { - set plwin .plwin -} - -############################################################################### -# Set up the menubar and message widgets. - -frame .menu -relief raised -borderwidth 3 - -button .menu.one -text "One" -command "myplot 1" -pack append .menu .menu.one {left expand fill} - -button .menu.two -text "Two" -command "myplot 2" -pack append .menu .menu.two {left expand fill} - -button .menu.three -text "Three" -command "myplot 3" -pack append .menu .menu.three {left expand fill} - -button .menu.four -text "Four" -command "myplot 4" -pack append .menu .menu.four {left expand fill} - -button .menu.exit -text "Exit" -command "quit 0" -pack append .menu .menu.exit {right expand fill} - -message .msg \ - -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ - -width 500 -borderwidth 1 \ - -text "TK01: Control x01c from TK" - -pack append . \ - .menu {top fillx} \ - .msg {top padx 5 pady 5 fill} - -tk_menuBar .menu .menu.one .menu.two .menu.three .menu.four .menu.exit - -############################################################################### - -if { $use_plxframe == 1 } then { - plxframe .plw - pack append . .plw {left expand fill} - -} else { - plframe .plwin - pack append . .plwin {left expand fill} -} - -bind $plwin L locate_on -bind $plwin <Escape> locate_off - -bind $plwin <Control-Button-1> rband_on -bind $plwin <Control-ButtonRelease-1> rband_off - -proc rband_on {} { - global plwin - $plwin configure -rubberband 1 -} - -proc rband_off {} { - global plwin - $plwin configure -rubberband 0 -} - -############################################################################### -# Definitions of procedures used in this script. - -# Punch eject and hold onto your seat !!! - -proc quit a { - exit -} - -# Utility routine. - -proc dpos w { - wm geometry $w +300+300 -} - -############################################################################### -# Here is a binding which allows you to obtain the world coordinates of a -# point or points through invoking a "Locate" mode. You could instead just -# turn it on somewhere in the script and leave it on if you prefer modeless -# behavior, although you can sometimes get into trouble if you move the -# crosshairs while a graphic draw is being performed (X is not forced to -# handle these events serially -- the crosshairs may be updated before the -# graphic draw is complete, and if the graphic draw then obscures the -# crosshairs it will leave traces of the crosshairs on the plot when you -# next move them). Note especially that in the body of this example -# "get_coords" proc, you can do anything you can do from Tcl. In -# particular, you need not put the data out to stdout (which is pretty -# boring). Instead, you can use this to feed the world coords to some more -# complicated Tcl proc of your choosing. Use the regexp parser to pull out -# the world x and y coordinates, etc. Have fun! - -proc locate_on {} { - global plwin - $plwin configure -xhairs 1 - bind $plwin <Shift-1> { get_coords %x %y } -} - -proc locate_off {} { - global plwin - $plwin configure -xhairs 0 - bind $plwin <Shift-1> {} -} - -proc get_coords {x y} { - global plwin - puts "world coordinates: [$plwin report wc $x $y]" -} - -############################################################################### Copied: trunk/examples/tk/tk01.in (from rev 10837, trunk/examples/tk/tk01) =================================================================== --- trunk/examples/tk/tk01.in (rev 0) +++ trunk/examples/tk/tk01.in 2010-03-03 02:13:34 UTC (rev 10838) @@ -0,0 +1,130 @@ +#!@xtk01_LOCATION@ -f +# -*-tcl-*- +# $Id$ +# +# Geoffrey Furnish +# 11 April 1994 +# +# @> A script for using Tk to control xtk01 +############################################################################### + +wm title . "x01c -- TK version" +plstdwin . + +# If you just want a bare plframe, set this to 0. + +set use_plxframe 1 + +if { $use_plxframe == 1 } then { + set plwin .plw.plwin +} else { + set plwin .plwin +} + +############################################################################### +# Set up the menubar and message widgets. + +frame .menu -relief raised -borderwidth 3 + +button .menu.one -text "One" -command "myplot 1" +pack append .menu .menu.one {left expand fill} + +button .menu.two -text "Two" -command "myplot 2" +pack append .menu .menu.two {left expand fill} + +button .menu.three -text "Three" -command "myplot 3" +pack append .menu .menu.three {left expand fill} + +button .menu.four -text "Four" -command "myplot 4" +pack append .menu .menu.four {left expand fill} + +button .menu.exit -text "Exit" -command "quit 0" +pack append .menu .menu.exit {right expand fill} + +message .msg \ + -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ + -width 500 -borderwidth 1 \ + -text "TK01: Control x01c from TK" + +pack append . \ + .menu {top fillx} \ + .msg {top padx 5 pady 5 fill} + +tk_menuBar .menu .menu.one .menu.two .menu.three .menu.four .menu.exit + +############################################################################### + +if { $use_plxframe == 1 } then { + plxframe .plw + pack append . .plw {left expand fill} + +} else { + plframe .plwin + pack append . .plwin {left expand fill} +} + +bind $plwin L locate_on +bind $plwin <Escape> locate_off + +bind $plwin <Control-Button-1> rband_on +bind $plwin <Control-ButtonRelease-1> rband_off + +proc rband_on {} { + global plwin + $plwin configure -rubberband 1 +} + +proc rband_off {} { + global plwin + $plwin configure -rubberband 0 +} + +############################################################################### +# Definitions of procedures used in this script. + +# Punch eject and hold onto your seat !!! + +proc quit a { + exit +} + +# Utility routine. + +proc dpos w { + wm geometry $w +300+300 +} + +############################################################################### +# Here is a binding which allows you to obtain the world coordinates of a +# point or points through invoking a "Locate" mode. You could instead just +# turn it on somewhere in the script and leave it on if you prefer modeless +# behavior, although you can sometimes get into trouble if you move the +# crosshairs while a graphic draw is being performed (X is not forced to +# handle these events serially -- the crosshairs may be updated before the +# graphic draw is complete, and if the graphic draw then obscures the +# crosshairs it will leave traces of the crosshairs on the plot when you +# next move them). Note especially that in the body of this example +# "get_coords" proc, you can do anything you can do from Tcl. In +# particular, you need not put the data out to stdout (which is pretty +# boring). Instead, you can use this to feed the world coords to some more +# complicated Tcl proc of your choosing. Use the regexp parser to pull out +# the world x and y coordinates, etc. Have fun! + +proc locate_on {} { + global plwin + $plwin configure -xhairs 1 + bind $plwin <Shift-1> { get_coords %x %y } +} + +proc locate_off {} { + global plwin + $plwin configure -xhairs 0 + bind $plwin <Shift-1> {} +} + +proc get_coords {x y} { + global plwin + puts "world coordinates: [$plwin report wc $x $y]" +} + +############################################################################### Property changes on: trunk/examples/tk/tk01.in ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/examples/tk/tk02 =================================================================== --- trunk/examples/tk/tk02 2010-03-01 20:52:41 UTC (rev 10837) +++ trunk/examples/tk/tk02 2010-03-03 02:13:34 UTC (rev 10838) @@ -1,190 +0,0 @@ -#!xtk02 -f -# -*-tcl-*- -# $Id$ -# -# Geoffrey Furnish -# 11 April 1994 -# -# @> A script for using Tk to control xtk01, using the PLplot itcl interface. -############################################################################### - -package require Itk - -wm title . "x01c -- TK version" -plstdwin . - -############################################################################### -# Set up the menubar and message widgets. - -frame .menu -relief raised -borderwidth 3 - -button .menu.one -text "One" -command "myplot1" -pack append .menu .menu.one {left expand fill} - -button .menu.two -text "Two" -command "myplot 2" -pack append .menu .menu.two {left expand fill} - -button .menu.three -text "Three" -command "plot2" -pack append .menu .menu.three {left expand fill} - -button .menu.four -text "Four" -command "myplot 4" -pack append .menu .menu.four {left expand fill} - -button .menu.five -text "Five" -command "gumbyplot" -pack append .menu .menu.five {left expand fill} - -button .menu.six -text "Six" -command "snoopy" -pack .menu.six -side left -expand 1 -fill x - -button .menu.exit -text "Exit" -command "quit 0" -pack append .menu .menu.exit {right expand fill} - -message .msg \ - -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ - -width 500 -borderwidth 1 \ - -text "TK02: Demo \[incr Tcl\] interface to PLplot" - -#PLXWin .plw -Pltkwin .plw - -pack append . .menu {top fillx} \ - .msg {top padx 5 pady 5 fill} \ - .plw {bottom expand fill} - -update - -tk_menuBar .menu .menu.one .menu.two .menu.three .menu.four .menu.exit - -############################################################################### -# Definitions of procedures used in this script. - -proc myplot1 {} { - global xscale yscale xoff yoff - - set xscale 6 - set yscale 1 - set xoff 0 - set yoff 0 - - plot1 -} - -# This is supposed to work just like the plot1() in x01c.c/xtk02.c - -proc plot1 {} { - global xscale yscale xoff yoff - - matrix x1 float 10 - matrix y1 float 10 - - for {set i 2; set n1 0} {$i < 60} {incr i 10; incr n1} { - set x [expr $xoff + $xscale * ($i + 1) / 60] - x1 $n1 = $x - y1 $n1 = [expr $yoff + $yscale * pow($x,2)] - } - - set n2 60 - matrix x2 float $n2 - matrix y2 float $n2 - - for {set i 0} {$i < $n2} {incr i} { - set x [expr $xoff + $xscale * ($i + 1) / $n2] - x2 $i = $x - y2 $i = [expr $yoff + $yscale * pow($x,2)] - } - - set xmax [x2 [expr $n2-1]] - set ymax [y2 [expr $n2-1]] - - .plw plcol 1 - .plw plenv $xoff $xmax $yoff $ymax 0 0 - .plw plcol 6 - .plw pllab "(x)" "(y)" "#frPLPLOT Example 1 - y=x#u2" - - # plot the data points - - .plw plcol 9 - .plw plpoin $n1 x1 y1 9 - - # plot the data points - - .plw plcol 4 - .plw plline $n2 x2 y2 -} - -# This is supposed to work just like the plot2() in x01c.c/xtk02.c - -proc plot2 {} { - .plw plcol 1 - .plw plenv -2 10 -.4 1.2 0 1 - .plw plcol 2 - .plw pllab "(x)" "sin(x)/x" "#frPLPLOT Example 1 - Sinc Function" - - # Fill up the array - - matrix x1 float 101 - matrix y1 float 101 - - for {set i 0} {$i < 101} {incr i} { - set x [expr ($i - 19.)/6.] - x1 $i = $x - y1 $i = 1 - if {$x != 0} { y1 $i = [expr sin($x)/$x] } - } - - .plw plcol 3 - .plw plline 101 x1 y1 -} - -proc gumbyplot {} { - .plw plcol 1 - .plw plenv 0 1 0 1 0 0 - .plw plcol 6 - .plw pllab "(x)" "(y)" "#frPLplot Example 1 - y=1-2x+2x#u2" - - matrix x1 float 101 - matrix y1 float 101 - - for {set i 0} {$i < 101} {incr i} { - set x [expr $i * .01] - x1 $i = $x - y1 $i = [expr 1 - 2 * $x + 2 * $x * $x] - } - - .plw plline 101 x1 y1 -} - -# This proc shows off the use of a matrix extension subcommand. - -proc snoopy {} { - - matrix x float 101 - matrix y float 101 - - for {set i 0} {$i < 101} {incr i} { - set xx [expr $i * .01] - x $i = $xx - } - - y stuff - - .plw plcol 1 - .plw plenv 0 1 0 1 0 0 - .plw plcol 6 - .plw pllab "(x)" "(y)" "#frDemo of Matrix extension subcommand" - .plw plline 101 x y -} - -# Punch eject and hold onto your seat !!! - -proc quit a { - exit -} - -# Utility routine. - -proc dpos w { - wm geometry $w +300+300 -} - -############################################################################### Copied: trunk/examples/tk/tk02.in (from rev 10837, trunk/examples/tk/tk02) =================================================================== --- trunk/examples/tk/tk02.in (rev 0) +++ trunk/examples/tk/tk02.in 2010-03-03 02:13:34 UTC (rev 10838) @@ -0,0 +1,190 @@ +#!@xtk02_LOCATION@ -f +# -*-tcl-*- +# $Id$ +# +# Geoffrey Furnish +# 11 April 1994 +# +# @> A script for using Tk to control xtk01, using the PLplot itcl interface. +############################################################################### + +package require Itk + +wm title . "x01c -- TK version" +plstdwin . + +############################################################################### +# Set up the menubar and message widgets. + +frame .menu -relief raised -borderwidth 3 + +button .menu.one -text "One" -command "myplot1" +pack append .menu .menu.one {left expand fill} + +button .menu.two -text "Two" -command "myplot 2" +pack append .menu .menu.two {left expand fill} + +button .menu.three -text "Three" -command "plot2" +pack append .menu .menu.three {left expand fill} + +button .menu.four -text "Four" -command "myplot 4" +pack append .menu .menu.four {left expand fill} + +button .menu.five -text "Five" -command "gumbyplot" +pack append .menu .menu.five {left expand fill} + +button .menu.six -text "Six" -command "snoopy" +pack .menu.six -side left -expand 1 -fill x + +button .menu.exit -text "Exit" -command "quit 0" +pack append .menu .menu.exit {right expand fill} + +message .msg \ + -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ + -width 500 -borderwidth 1 \ + -text "TK02: Demo \[incr Tcl\] interface to PLplot" + +#PLXWin .plw +Pltkwin .plw + +pack append . .menu {top fillx} \ + .msg {top padx 5 pady 5 fill} \ + .plw {bottom expand fill} + +update + +tk_menuBar .menu .menu.one .menu.two .menu.three .menu.four .menu.exit + +############################################################################### +# Definitions of procedures used in this script. + +proc myplot1 {} { + global xscale yscale xoff yoff + + set xscale 6 + set yscale 1 + set xoff 0 + set yoff 0 + + plot1 +} + +# This is supposed to work just like the plot1() in x01c.c/xtk02.c + +proc plot1 {} { + global xscale yscale xoff yoff + + matrix x1 float 10 + matrix y1 float 10 + + for {set i 2; set n1 0} {$i < 60} {incr i 10; incr n1} { + set x [expr $xoff + $xscale * ($i + 1) / 60] + x1 $n1 = $x + y1 $n1 = [expr $yoff + $yscale * pow($x,2)] + } + + set n2 60 + matrix x2 float $n2 + matrix y2 float $n2 + + for {set i 0} {$i < $n2} {incr i} { + set x [expr $xoff + $xscale * ($i + 1) / $n2] + x2 $i = $x + y2 $i = [expr $yoff + $yscale * pow($x,2)] + } + + set xmax [x2 [expr $n2-1]] + set ymax [y2 [expr $n2-1]] + + .plw plcol 1 + .plw plenv $xoff $xmax $yoff $ymax 0 0 + .plw plcol 6 + .plw pllab "(x)" "(y)" "#frPLPLOT Example 1 - y=x#u2" + + # plot the data points + + .plw plcol 9 + .plw plpoin $n1 x1 y1 9 + + # plot the data points + + .plw plcol 4 + .plw plline $n2 x2 y2 +} + +# This is supposed to work just like the plot2() in x01c.c/xtk02.c + +proc plot2 {} { + .plw plcol 1 + .plw plenv -2 10 -.4 1.2 0 1 + .plw plcol 2 + .plw pllab "(x)" "sin(x)/x" "#frPLPLOT Example 1 - Sinc Function" + + # Fill up the array + + matrix x1 float 101 + matrix y1 float 101 + + for {set i 0} {$i < 101} {incr i} { + set x [expr ($i - 19.)/6.] + x1 $i = $x + y1 $i = 1 + if {$x != 0} { y1 $i = [expr sin($x)/$x] } + } + + .plw plcol 3 + .plw plline 101 x1 y1 +} + +proc gumbyplot {} { + .plw plcol 1 + .plw plenv 0 1 0 1 0 0 + .plw plcol 6 + .plw pllab "(x)" "(y)" "#frPLplot Example 1 - y=1-2x+2x#u2" + + matrix x1 float 101 + matrix y1 float 101 + + for {set i 0} {$i < 101} {incr i} { + set x [expr $i * .01] + x1 $i = $x + y1 $i = [expr 1 - 2 * $x + 2 * $x * $x] + } + + .plw plline 101 x1 y1 +} + +# This proc shows off the use of a matrix extension subcommand. + +proc snoopy {} { + + matrix x float 101 + matrix y float 101 + + for {set i 0} {$i < 101} {incr i} { + set xx [expr $i * .01] + x $i = $xx + } + + y stuff + + .plw plcol 1 + .plw plenv 0 1 0 1 0 0 + .plw plcol 6 + .plw pllab "(x)" "(y)" "#frDemo of Matrix extension subcommand" + .plw plline 101 x y +} + +# Punch eject and hold onto your seat !!! + +proc quit a { + exit +} + +# Utility routine. + +proc dpos w { + wm geometry $w +300+300 +} + +############################################################################### Property changes on: trunk/examples/tk/tk02.in ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/examples/tk/tk03 =================================================================== --- trunk/examples/tk/tk03 2010-03-01 20:52:41 UTC (rev 10837) +++ trunk/examples/tk/tk03 2010-03-03 02:13:34 UTC (rev 10838) @@ -1,288 +0,0 @@ -#!/bin/sh -#--------------------------------*- Tcl -*------------------------------------# -# $Id$ -# -# Maurice LeBrun -# 30 Jun 1994 -# -# @> A script illustrating multiple toplevel plframes. -#-----------------------------------------------------------------------------# -#\ -exec plserver -f "$0" ${1+"$@"} - -# Note: I defer running "open_main" until later to make sure everything -# has been sourced. - -wm title . "tk03" -plstdwin . - -set child_count 1 - -# If you just want a bare plframe, set this to 0. - -set use_plxframe 1 - -############################################################################### -# Set up the menubar and message widgets for main window. - -proc open_main {} { - - global use_plxframe - - if { $use_plxframe == 1 } then { - set plwin .plw.plwin - } else { - set plwin .plwin - } - - frame .menu -relief raised -borderwidth 3 - - button .menu.one -text "One" -command "1 $plwin" - pack append .menu .menu.one {left expand fill} - - button .menu.two -text "Two" -command "2 $plwin" - pack append .menu .menu.two {left expand fill} - - button .menu.open -text "Open new" -command "open_child" - pack append .menu .menu.open {left expand fill} - - button .menu.exit -text "Exit" -command "destroy ." - -#"quit 0" - - pack append .menu .menu.exit {right expand fill} - - message .msg \ - -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ - -width 500 -borderwidth 1 \ - -text "TK03: Multiple toplevels with plframes" - - pack append . \ - .menu {top fillx} \ - .msg {top padx 5 pady 5 fill} - - tk_menuBar .menu .menu.one .menu.two .menu.exit - - if { $use_plxframe == 1 } then { - plxframe .plw - pack append . .plw {left expand fill} - } else { - plframe .plwin - pack append . .plwin {left expand fill} - } -} - -############################################################################### -# Set up the second toplevel - -proc open_child {} { - - global child_count use_plxframe - - set w .$child_count - - toplevel $w - plstdwin $w - - if { $use_plxframe == 1 } then { - set plwin $w.plw.plwin - } else { - set plwin $w.plwin - } - -# Set up the second menubar and message widgets. - - frame $w.menu -relief raised -borderwidth 3 - - button $w.menu.three -text "Three" -command "plot2 $plwin" - pack append $w.menu $w.menu.three {left expand fill} - - button $w.menu.four -text "Four" -command "plot3 $plwin" - pack append $w.menu $w.menu.four {left expand fill} - - button $w.menu.exit -text "Dismiss" -command "destroy $w" - pack append $w.menu $w.menu.exit {right expand fill} - - message $w.msg \ - -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ - -width 500 -borderwidth 1 \ - -text "TK03: toplevel $child_count" - - pack append $w \ - $w.menu {top fillx} \ - $w.msg {top padx 5 pady 5 fill} - - tk_menuBar $w.menu $w.menu.three $w.menu.four - -# This creates the plframe "megawidget". If you just want a bare plframe, -# change use_plxframe to 0. - - if { $use_plxframe == 1 } then { - plxframe $w.plw - pack append $w $w.plw {left expand fill} - } else { - plframe $w.plwin - pack append $w $w.plwin {left expand fill} - } - - incr child_count -} - -############################################################################### -# Utility routines - -# Punch eject and hold onto your seat !!! - -proc quit a { - exit -} - -# Utility routine. - -proc dpos w { - wm geometry $w +300+300 -} - -############################################################################### -# Plotting routines -############################################################################### - -proc 1 {w} { - global xscale yscale xoff yoff - - set xscale 6.0 - set yscale 1.0 - set xoff 0.0 - set yoff 0.0 - - plot1 $w -} - -proc 2 {w} { - global xscale yscale xoff yoff - - set xscale 1.0 - set yscale 0.0014 - set xoff 0.0 - set yoff 0.0185 - - $w cmd plsyax 5 - - plot1 $w -} - -# This is supposed to work just like the plot1() in x01c.c - -proc plot1 {w} { - global xscale yscale xoff yoff - - set npts 60 - matrix x f $npts - matrix y f $npts - - for {set i 0} {$i < $npts} {incr i} { - x $i = [expr $xoff + $xscale * ($i + 1) / $npts] - y $i = [expr $yoff + $yscale * pow([x $i],2)] - } - - set xmax [x [expr $npts-1]] - set ymax [y [expr $npts-1]] - - matrix x1 f 6 - matrix y1 f 6 - - for {set i 0} {$i < 6} {incr i} { - set j [expr $i*10+3] - x1 $i = [x $j] - y1 $i = [y $j] - } - - $w cmd plcol 1 - $w cmd plenv $xoff $xmax $yoff $ymax 0 0 - $w cmd plcol 6 - $w cmd pllab "(x)" "(y)" "#frPLplot Example 1 - y=x#u2" - - # plot the data points - - $w cmd plcol 9 - $w cmd plpoin 6 x1 y1 9 - - # draw the line through the data - - $w cmd plcol 4 - $w cmd plline $npts x y -} - -# This is supposed to work just like the plot2() in x01c.c - -proc plot2 {w} { - $w cmd plcol 1 - $w cmd plenv -2 10 -.4 1.2 0 1 - $w cmd plcol 2 - $w cmd pllab "(x)" "sin(x)/x" "#frPLplot Example 1 - Sinc Function" - - # Fill up the array - - matrix x1 f 101 - matrix y1 f 101 - - for {set i 0} {$i < 101} {incr i} { - set x [expr ($i - 19.)/6.] - x1 $i = $x - y1 $i = 1 - if {$x != 0} { y1 $i = [expr sin($x)/$x] } - } - - $w cmd plcol 3 - $w cmd plline 101 x1 y1 -} - -# This is supposed to work just like the plot3() in x01c.c - -proc plot3 {w} { - - $w cmd pladv - $w cmd plvsta - $w cmd plwind 0.0 360.0 -1.2 1.2 - -# Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. - - $w cmd plcol 1 - $w cmd plbox "bcnst" 60.0 2 "bcnstv" 0.2 2 - -# Superimpose a dashed line grid, with 1.5 mm marks and spaces. -# plstyl expects two integer matrices for mark and space! - - matrix mark i 1 - matrix space i 1 - - mark 0 = 1500 - space 0 = 1500 - $w cmd plstyl 1 mark space - - $w cmd plcol 2 - $w cmd plbox "g" 30.0 0 "g" 0.2 0 - - mark 0 = 0 - space 0 = 0 - $w cmd plstyl 0 mark space - - $w cmd plcol 3 - $w cmd pllab "Angle (degrees)" "sine" "#frPLplot Example 1 - Sine function" - - matrix x f 101 - matrix y f 101 - - for {set i 0} {$i < 101} {incr i} { - x $i = [expr 3.6 * $i] - y $i = [expr sin([x $i] * 3.141592654 / 180.0)] - } - - $w cmd plcol 4 - $w cmd plline 101 x y -} - -############################################################################### - -open_main - Copied: trunk/examples/tk/tk03.in (from rev 10837, trunk/examples/tk/tk03) =================================================================== --- trunk/examples/tk/tk03.in (rev 0) +++ trunk/examples/tk/tk03.in 2010-03-03 02:13:34 UTC (rev 10838) @@ -0,0 +1,288 @@ +#!/bin/sh +#--------------------------------*- Tcl -*------------------------------------# +# $Id$ +# +# Maurice LeBrun +# 30 Jun 1994 +# +# @> A script illustrating multiple toplevel plframes. +#-----------------------------------------------------------------------------# +#\ +exec @plserver_LOCATION@ -f "$0" ${1+"$@"} + +# Note: I defer running "open_main" until later to make sure everything +# has been sourced. + +wm title . "tk03" +plstdwin . + +set child_count 1 + +# If you just want a bare plframe, set this to 0. + +set use_plxframe 1 + +############################################################################### +# Set up the menubar and message widgets for main window. + +proc open_main {} { + + global use_plxframe + + if { $use_plxframe == 1 } then { + set plwin .plw.plwin + } else { + set plwin .plwin + } + + frame .menu -relief raised -borderwidth 3 + + button .menu.one -text "One" -command "1 $plwin" + pack append .menu .menu.one {left expand fill} + + button .menu.two -text "Two" -command "2 $plwin" + pack append .menu .menu.two {left expand fill} + + button .menu.open -text "Open new" -command "open_child" + pack append .menu .menu.open {left expand fill} + + button .menu.exit -text "Exit" -command "destroy ." + +#"quit 0" + + pack append .menu .menu.exit {right expand fill} + + message .msg \ + -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ + -width 500 -borderwidth 1 \ + -text "TK03: Multiple toplevels with plframes" + + pack append . \ + .menu {top fillx} \ + .msg {top padx 5 pady 5 fill} + + tk_menuBar .menu .menu.one .menu.two .menu.exit + + if { $use_plxframe == 1 } then { + plxframe .plw + pack append . .plw {left expand fill} + } else { + plframe .plwin + pack append . .plwin {left expand fill} + } +} + +############################################################################### +# Set up the second toplevel + +proc open_child {} { + + global child_count use_plxframe + + set w .$child_count + + toplevel $w + plstdwin $w + + if { $use_plxframe == 1 } then { + set plwin $w.plw.plwin + } else { + set plwin $w.plwin + } + +# Set up the second menubar and message widgets. + + frame $w.menu -relief raised -borderwidth 3 + + button $w.menu.three -text "Three" -command "plot2 $plwin" + pack append $w.menu $w.menu.three {left expand fill} + + button $w.menu.four -text "Four" -command "plot3 $plwin" + pack append $w.menu $w.menu.four {left expand fill} + + button $w.menu.exit -text "Dismiss" -command "destroy $w" + pack append $w.menu $w.menu.exit {right expand fill} + + message $w.msg \ + -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ + -width 500 -borderwidth 1 \ + -text "TK03: toplevel $child_count" + + pack append $w \ + $w.menu {top fillx} \ + $w.msg {top padx 5 pady 5 fill} + + tk_menuBar $w.menu $w.menu.three $w.menu.four + +# This creates the plframe "megawidget". If you just want a bare plframe, +# change use_plxframe to 0. + + if { $use_plxframe == 1 } then { + plxframe $w.plw + pack append $w $w.plw {left expand fill} + } else { + plframe $w.plwin + pack append $w $w.plwin {left expand fill} + } + + incr child_count +} + +############################################################################### +# Utility routines + +# Punch eject and hold onto your seat !!! + +proc quit a { + exit +} + +# Utility routine. + +proc dpos w { + wm geometry $w +300+300 +} + +############################################################################### +# Plotting routines +############################################################################### + +proc 1 {w} { + global xscale yscale xoff yoff + + set xscale 6.0 + set yscale 1.0 + set xoff 0.0 + set yoff 0.0 + + plot1 $w +} + +proc 2 {w} { + global xscale yscale xoff yoff + + set xscale 1.0 + set yscale 0.0014 + set xoff 0.0 + set yoff 0.0185 + + $w cmd plsyax 5 + + plot1 $w +} + +# This is supposed to work just like the plot1() in x01c.c + +proc plot1 {w} { + global xscale yscale xoff yoff + + set npts 60 + matrix x f $npts + matrix y f $npts + + for {set i 0} {$i < $npts} {incr i} { + x $i = [expr $xoff + $xscale * ($i + 1) / $npts] + y $i = [expr $yoff + $yscale * pow([x $i],2)] + } + + set xmax [x [expr $npts-1]] + set ymax [y [expr $npts-1]] + + matrix x1 f 6 + matrix y1 f 6 + + for {set i 0} {$i < 6} {incr i} { + set j [expr $i*10+3] + x1 $i = [x $j] + y1 $i = [y $j] + } + + $w cmd plcol 1 + $w cmd plenv $xoff $xmax $yoff $ymax 0 0 + $w cmd plcol 6 + $w cmd pllab "(x)" "(y)" "#frPLplot Example 1 - y=x#u2" + + # plot the data points + + $w cmd plcol 9 + $w cmd plpoin 6 x1 y1 9 + + # draw the line through the data + + $w cmd plcol 4 + $w cmd plline $npts x y +} + +# This is supposed to work just like the plot2() in x01c.c + +proc plot2 {w} { + $w cmd plcol 1 + $w cmd plenv -2 10 -.4 1.2 0 1 + $w cmd plcol 2 + $w cmd pllab "(x)" "sin(x)/x" "#frPLplot Example 1 - Sinc Function" + + # Fill up the array + + matrix x1 f 101 + matrix y1 f 101 + + for {set i 0} {$i < 101} {incr i} { + set x [expr ($i - 19.)/6.] + x1 $i = $x + y1 $i = 1 + if {$x != 0} { y1 $i = [expr sin($x)/$x] } + } + + $w cmd plcol 3 + $w cmd plline 101 x1 y1 +} + +# This is supposed to work just like the plot3() in x01c.c + +proc plot3 {w} { + + $w cmd pladv + $w cmd plvsta + $w cmd plwind 0.0 360.0 -1.2 1.2 + +# Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. + + $w cmd plcol 1 + $w cmd plbox "bcnst" 60.0 2 "bcnstv" 0.2 2 + +# Superimpose a dashed line grid, with 1.5 mm marks and spaces. +# plstyl expects two integer matrices for mark and space! + + matrix mark i 1 + matrix space i 1 + + mark 0 = 1500 + space 0 = 1500 + $w cmd plstyl 1 mark space + + $w cmd plcol 2 + $w cmd plbox "g" 30.0 0 "g" 0.2 0 + + mark 0 = 0 + space 0 = 0 + $w cmd plstyl 0 mark space + + $w cmd plcol 3 + $w cmd pllab "Angle (degrees)" "sine" "#frPLplot Example 1 - Sine function" + + matrix x f 101 + matrix y f 101 + + for {set i 0} {$i < 101} {incr i} { + x $i = [expr 3.6 * $i] + y $i = [expr sin([x $i] * 3.141592654 / 180.0)] + } + + $w cmd plcol 4 + $w cmd plline 101 x y +} + +############################################################################### + +open_main + Property changes on: trunk/examples/tk/tk03.in ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: trunk/examples/tk/tk04 =================================================================== --- trunk/examples/tk/tk04 2010-03-01 20:52:41 UTC (rev 10837) +++ trunk/examples/tk/tk04 2010-03-03 02:13:34 UTC (rev 10838) @@ -1,122 +0,0 @@ -#!xtk04 -f -# -*-tcl-*- -# $Id$ -# Maurice LeBrun -# 30 Jun 1994 -# -# @> A script illustrating use of 2-d tcl api (plframe). -############################################################################### - -package require Itk - -wm title . "tk04" -plstdwin . - -############################################################################### -# Set up the menubar and message widgets. - -frame .menu -relief raised -borderwidth 3 - -button .menu.comp -text "Compute Function" -command "compute" -button .menu.contour -text "Line Contour" -command "contour" -button .menu.shade -text "Color Fill Contour" -command "shade" -pack .menu.comp .menu.contour .menu.shade -side left - -button .menu.exit -text "Exit" -command "destroy ." -pack .menu.exit -side right - -message .msg \ - -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ - -width 500 -borderwidth 1 \ - -text "TK04: 2-d Tcl API" - -pack .menu .msg -fill x - -tk_menuBar .menu .menu.comp .menu.contour .menu.shade .menu.exit - -PLXWin .plw -pack .plw -side bottom -expand 1 -fill both - -matrix x f 64 64 - -# This is the front end to the data computation. Initially we just -# create the matrix to hold the data, and then vector down to the C -# side to set the data. However, one could easily embellish this to -# accept specifications from the user (via Tk entries), and act on -# them. For instance, choosing the size of the matrix, passing -# paramaters to the compiled side, etc. - -proc compute {} { - - global x - - get_data x -} - -# Draw a contour of the data. - -proc contour {} { - - global x - - .plw pladv - .plw plvpor 0.1 0.9 0.1 0.9 - .plw plwind 1. 64. 1. 64. - - .plw plcol 6 - .plw pllab "(x)" "(y)" "#frPLplot Example Tk04" - - # plot the data points - - .plw plcol 9 - - matrix clev f 10 - - set max [x max] - set min [x min] - - for {set i 0} {$i < 10} {incr i} { - clev $i = [expr $min + ($max-$min)*($i+.5)/10 ] - } - - .plw plcont x clev - - .plw plcol 1 - .plw plbox "bcnst" 0.0 0 "bcnstv" 0.0 0 -} - -proc shade {} { - - global x - - .plw pladv - .plw plvpor 0.1 0.9 0.1 0.9 - .plw plwind 0. 1. 0. 1. - - .plw plcol 6 - .plw pllab "(x)" "(y)" "Cool shade plot example from Tcl" - - set max [x max] - set min [x min] - - set xmin 0 - set xmax 1 - set ymin 0 - set ymax 1 - - for {set i 0} {$i < 20} {incr i} { - set sh_min [expr $min + ($max-$min)*$i/20.] - set sh_max [expr $min + ($max-$min)*($i+1)/20.] - set sh_col [expr $i/20.] - - .plw plshade x $xmin $xmax $ymin $ymax $sh_min $sh_max 1 $sh_col 0 \ - 1 0 0 0 \ - 1 - - } - - .plw plcol 1 - .plw plbox "bcnst" 0.0 0 "bcnstv" 0.0 0 -} - -############################################################################### Copied: trunk/examples/tk/tk04.in (from rev 10837, trunk/examples/tk/tk04) =================================================================== --- trunk/examples/tk/tk04.in (rev 0) +++ trunk/examples/tk/tk04.in 2010-03-03 02:13:34 UTC (rev 10838) @@ -0,0 +1,122 @@ +#!@xtk04_LOCATION@ -f +# -*-tcl-*- +# $Id$ +# Maurice LeBrun +# 30 Jun 1994 +# +# @> A script illustrating use of 2-d tcl api (plframe). +############################################################################### + +package require Itk + +wm title . "tk04" +plstdwin . + +############################################################################### +# Set up the menubar and message widgets. + +frame .menu -relief raised -borderwidth 3 + +button .menu.comp -text "Compute Function" -command "compute" +button .menu.contour -text "Line Contour" -command "contour" +button .menu.shade -text "Color Fill Contour" -command "shade" +pack .menu.comp .menu.contour .menu.shade -side left + +button .menu.exit -text "Exit" -command "destroy ." +pack .menu.exit -side right + +message .msg \ + -font -Adobe-helvetica-medium-r-normal--*-240* -aspect 200 \ + -width 500 -borderwidth 1 \ + -text "TK04: 2-d Tcl API" + +pack .menu .msg -fill x + +tk_menuBar .menu .menu.comp .menu.contour .menu.shade .menu.exit + +PLXWin .plw +pack .plw -side bottom -expand 1 -fill both + +matrix x f 64 64 + +# This is the front end to the data computation. Initially we just +# create the matrix to hold the data, and then vector down to the C +# side to set the data. However, one could easily embellish this to +# accept specifications from the user (via Tk entries), and act on +# them. For instance, choosing the size of the matrix, passing +# paramaters to the compiled side, etc. + +proc compute {} { + + global x + + get_data x +} + +# Draw a contour of the data. + +proc contour {} { + + global x + + .plw pladv + .plw plvpor 0.1 0.9 0.1 0.9 + .plw plwind 1. 64. 1. 64. + + .plw plcol 6 + .plw pllab "(x)" "(y)" "#frPLplot Example Tk04" + + # plot the data points + + .plw plcol 9 + + matrix clev f 10 + + set max [x max] + set min [x min] + + for {set i 0} {$i < 10} {incr i} { + clev $i = [expr $min + ($max-$min)*($i+.5)/10 ] + } + + .plw plcont x clev + + .plw plcol 1 + .plw plbox "bcnst" 0.0 0 "bcnstv" 0.0 0 +} + +proc shade {} { + + global x + + .plw pladv + .plw plvpor 0.1 0.9 0.1 0.9 + .plw plwind 0. 1. 0. 1. + + .plw plcol 6 + .plw pllab "(x)" "(y)" "Cool shade plot example from Tcl" + + set max [x max] + set min [x min] + + set xmin 0 + set xmax 1 + set ymin 0 + set ymax 1 + + for {set i 0} {$i < 20} {incr i} { + set sh_min [expr $min + ($max-$min)*$i/20.] + set sh_max [expr $min + ($max-$min)*($i+1)/20.] + set sh_col [expr $i/20.] + + .plw plshade x $xmin $xmax $ymin $ymax $sh_min $sh_max 1 $sh_col 0 \ + 1 0 0 0 \ + 1 + + } + + .plw plcol 1 + .plw plbox "bcnst" 0.0 0 "bcnstv" 0.0 0 +} + +############################################################################### Property changes on: trunk/examples/tk/tk04.in ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-03-19 21:57:24
|
Revision: 11657 http://plplot.svn.sourceforge.net/plplot/?rev=11657&view=rev Author: airwin Date: 2011-03-19 21:57:18 +0000 (Sat, 19 Mar 2011) Log Message: ----------- plcol (which has been removed) is replaced by plcol0. Modified Paths: -------------- trunk/examples/tk/tk02.in trunk/examples/tk/tk03.in trunk/examples/tk/tk04.in Modified: trunk/examples/tk/tk02.in =================================================================== --- trunk/examples/tk/tk02.in 2011-03-19 21:56:35 UTC (rev 11656) +++ trunk/examples/tk/tk02.in 2011-03-19 21:57:18 UTC (rev 11657) @@ -96,28 +96,28 @@ set xmax [x2 [expr $n2-1]] set ymax [y2 [expr $n2-1]] - .plw plcol 1 + .plw plcol0 1 .plw plenv $xoff $xmax $yoff $ymax 0 0 - .plw plcol 6 + .plw plcol0 6 .plw pllab "(x)" "(y)" "#frPLPLOT Example 1 - y=x#u2" # plot the data points - .plw plcol 9 + .plw plcol0 9 .plw plpoin $n1 x1 y1 9 # plot the data points - .plw plcol 4 + .plw plcol0 4 .plw plline $n2 x2 y2 } # This is supposed to work just like the plot2() in x01c.c/xtk02.c proc plot2 {} { - .plw plcol 1 + .plw plcol0 1 .plw plenv -2 10 -.4 1.2 0 1 - .plw plcol 2 + .plw plcol0 2 .plw pllab "(x)" "sin(x)/x" "#frPLPLOT Example 1 - Sinc Function" # Fill up the array @@ -132,14 +132,14 @@ if {$x != 0} { y1 $i = [expr sin($x)/$x] } } - .plw plcol 3 + .plw plcol0 3 .plw plline 101 x1 y1 } proc gumbyplot {} { - .plw plcol 1 + .plw plcol0 1 .plw plenv 0 1 0 1 0 0 - .plw plcol 6 + .plw plcol0 6 .plw pllab "(x)" "(y)" "#frPLplot Example 1 - y=1-2x+2x#u2" matrix x1 float 101 @@ -168,9 +168,9 @@ y stuff - .plw plcol 1 + .plw plcol0 1 .plw plenv 0 1 0 1 0 0 - .plw plcol 6 + .plw plcol0 6 .plw pllab "(x)" "(y)" "#frDemo of Matrix extension subcommand" .plw plline 101 x y } Modified: trunk/examples/tk/tk03.in =================================================================== --- trunk/examples/tk/tk03.in 2011-03-19 21:56:35 UTC (rev 11656) +++ trunk/examples/tk/tk03.in 2011-03-19 21:57:18 UTC (rev 11657) @@ -197,28 +197,28 @@ y1 $i = [y $j] } - $w cmd plcol 1 + $w cmd plcol0 1 $w cmd plenv $xoff $xmax $yoff $ymax 0 0 - $w cmd plcol 6 + $w cmd plcol0 6 $w cmd pllab "(x)" "(y)" "#frPLplot Example 1 - y=x#u2" # plot the data points - $w cmd plcol 9 + $w cmd plcol0 9 $w cmd plpoin 6 x1 y1 9 # draw the line through the data - $w cmd plcol 4 + $w cmd plcol0 4 $w cmd plline $npts x y } # This is supposed to work just like the plot2() in x01c.c proc plot2 {w} { - $w cmd plcol 1 + $w cmd plcol0 1 $w cmd plenv -2 10 -.4 1.2 0 1 - $w cmd plcol 2 + $w cmd plcol0 2 $w cmd pllab "(x)" "sin(x)/x" "#frPLplot Example 1 - Sinc Function" # Fill up the array @@ -233,7 +233,7 @@ if {$x != 0} { y1 $i = [expr sin($x)/$x] } } - $w cmd plcol 3 + $w cmd plcol0 3 $w cmd plline 101 x1 y1 } @@ -247,7 +247,7 @@ # Draw a box with ticks spaced 60 degrees apart in X, and 0.2 in Y. - $w cmd plcol 1 + $w cmd plcol0 1 $w cmd plbox "bcnst" 60.0 2 "bcnstv" 0.2 2 # Superimpose a dashed line grid, with 1.5 mm marks and spaces. @@ -260,14 +260,14 @@ space 0 = 1500 $w cmd plstyl 1 mark space - $w cmd plcol 2 + $w cmd plcol0 2 $w cmd plbox "g" 30.0 0 "g" 0.2 0 mark 0 = 0 space 0 = 0 $w cmd plstyl 0 mark space - $w cmd plcol 3 + $w cmd plcol0 3 $w cmd pllab "Angle (degrees)" "sine" "#frPLplot Example 1 - Sine function" matrix x f 101 @@ -278,7 +278,7 @@ y $i = [expr sin([x $i] * 3.141592654 / 180.0)] } - $w cmd plcol 4 + $w cmd plcol0 4 $w cmd plline 101 x y } Modified: trunk/examples/tk/tk04.in =================================================================== --- trunk/examples/tk/tk04.in 2011-03-19 21:56:35 UTC (rev 11656) +++ trunk/examples/tk/tk04.in 2011-03-19 21:57:18 UTC (rev 11657) @@ -63,12 +63,12 @@ .plw plvpor 0.1 0.9 0.1 0.9 .plw plwind 1. 64. 1. 64. - .plw plcol 6 + .plw plcol0 6 .plw pllab "(x)" "(y)" "#frPLplot Example Tk04" # plot the data points - .plw plcol 9 + .plw plcol0 9 matrix clev f 10 @@ -81,7 +81,7 @@ .plw plcont x clev - .plw plcol 1 + .plw plcol0 1 .plw plbox "bcnst" 0.0 0 "bcnstv" 0.0 0 } @@ -93,7 +93,7 @@ .plw plvpor 0.1 0.9 0.1 0.9 .plw plwind 0. 1. 0. 1. - .plw plcol 6 + .plw plcol0 6 .plw pllab "(x)" "(y)" "Cool shade plot example from Tcl" set max [x max] @@ -115,7 +115,7 @@ } - .plw plcol 1 + .plw plcol0 1 .plw plbox "bcnst" 0.0 0 "bcnstv" 0.0 0 } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-10-28 19:02:59
|
Revision: 12014 http://plplot.svn.sourceforge.net/plplot/?rev=12014&view=rev Author: andrewross Date: 2011-10-28 19:02:53 +0000 (Fri, 28 Oct 2011) Log Message: ----------- Update tk examples to fix a few compiler warnings. Modified Paths: -------------- trunk/examples/tk/xtk01.c trunk/examples/tk/xtk02.c trunk/examples/tk/xtk04.c Modified: trunk/examples/tk/xtk01.c =================================================================== --- trunk/examples/tk/xtk01.c 2011-10-28 18:07:43 UTC (rev 12013) +++ trunk/examples/tk/xtk01.c 2011-10-28 19:02:53 UTC (rev 12014) @@ -341,7 +341,7 @@ { XSPA, 0.0, -1.0, 0.0, YSPA, -1.0 }; static void -mypltr( PLFLT xloc, PLFLT yloc, PLFLT *tx, PLFLT *ty, void *pltr_data ) +mypltr( PLFLT xloc, PLFLT yloc, PLFLT *tx, PLFLT *ty, void * PL_UNUSED( pltr_data ) ) { *tx = tr[0] * xloc + tr[1] * yloc + tr[2]; *ty = tr[3] * xloc + tr[4] * yloc + tr[5]; @@ -489,7 +489,7 @@ } //-------------------------------------------------------------------------- -int myplotCmd( ClientData cd, Tcl_Interp *interp, int argc, char **argv ) +int myplotCmd( ClientData PL_UNUSED( cd ), Tcl_Interp *PL_UNUSED( interp ), int PL_UNUSED( argc ), char **argv ) { if ( !strcmp( argv[1], "1" ) ) myplot1(); Modified: trunk/examples/tk/xtk02.c =================================================================== --- trunk/examples/tk/xtk02.c 2011-10-28 18:07:43 UTC (rev 12013) +++ trunk/examples/tk/xtk02.c 2011-10-28 19:02:53 UTC (rev 12014) @@ -37,7 +37,7 @@ //-------------------------------------------------------------------------- int stuff( tclMatrix *pm, Tcl_Interp *interp, - int argc, const char *argv[] ) + int PL_UNUSED( argc ), const char * PL_UNUSED( argv []) ) { int i; PLFLT x, y; @@ -335,7 +335,7 @@ plline( 101, x, y ); } -int myplotCmd( ClientData cd, Tcl_Interp *interp, int argc, char **argv ) +int myplotCmd( ClientData PL_UNUSED( cd ), Tcl_Interp *PL_UNUSED( interp ), int PL_UNUSED( argc ), char **argv ) { if ( !strcmp( argv[1], "1" ) ) myplot1(); Modified: trunk/examples/tk/xtk04.c =================================================================== --- trunk/examples/tk/xtk04.c 2011-10-28 18:07:43 UTC (rev 12013) +++ trunk/examples/tk/xtk04.c 2011-10-28 19:02:53 UTC (rev 12014) @@ -30,7 +30,7 @@ int mat_min( tclMatrix *pm, Tcl_Interp *interp, int argc, const char *argv[] ); int mat_max( tclMatrix *pm, Tcl_Interp *interp, - int argc, const char *argv[] ) + int PL_UNUSED( argc ), const char *PL_UNUSED( argv[] ) ) { PLFLT max = pm->fdata[0]; int i; @@ -43,7 +43,7 @@ } int mat_min( tclMatrix *pm, Tcl_Interp *interp, - int argc, const char *argv[] ) + int PL_UNUSED( argc ), const char *PL_UNUSED( argv[] ) ) { PLFLT min = pm->fdata[0]; int i; @@ -112,7 +112,7 @@ //-------------------------------------------------------------------------- // -int get_dataCmd( ClientData, Tcl_Interp *, int, char ** ); +int get_dataCmd( ClientData, Tcl_Interp *, int, char ** ); static int AppInit( Tcl_Interp *interp ) @@ -149,7 +149,8 @@ return TCL_OK; } -int get_dataCmd( ClientData cd, Tcl_Interp *interp, int argc, char **argv ) +int +get_dataCmd( ClientData PL_UNUSED( cd ), Tcl_Interp *interp, int PL_UNUSED( argc ), char **argv ) { tclMatrix *pm, *matPtr; int nx, ny, i, j; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <and...@us...> - 2011-11-30 22:04:49
|
Revision: 12077 http://plplot.svn.sourceforge.net/plplot/?rev=12077&view=rev Author: andrewross Date: 2011-11-30 22:04:42 +0000 (Wed, 30 Nov 2011) Log Message: ----------- The Tcl interp->result string should not be set directly, but via Tcl_SetResult. Direct access is deprecated and is a potential source of memory leaks / string errors. This still needs fixing up in the tk bindings as well. Modified Paths: -------------- trunk/examples/tk/xtk02.c trunk/examples/tk/xtk04.c Modified: trunk/examples/tk/xtk02.c =================================================================== --- trunk/examples/tk/xtk02.c 2011-11-30 14:22:37 UTC (rev 12076) +++ trunk/examples/tk/xtk02.c 2011-11-30 22:04:42 UTC (rev 12077) @@ -52,7 +52,7 @@ pm->fdata[i] = y; } - interp->result = "Things are cool in gumbyville."; + Tcl_SetResult( interp, (char *) "Things are cool in gumbyville.", TCL_STATIC ); return TCL_OK; } Modified: trunk/examples/tk/xtk04.c =================================================================== --- trunk/examples/tk/xtk04.c 2011-11-30 14:22:37 UTC (rev 12076) +++ trunk/examples/tk/xtk04.c 2011-11-30 22:04:42 UTC (rev 12077) @@ -33,12 +33,14 @@ int PL_UNUSED( argc ), const char *PL_UNUSED( argv[] ) ) { PLFLT max = pm->fdata[0]; + char res[30]; int i; for ( i = 1; i < pm->len; i++ ) if ( pm->fdata[i] > max ) max = pm->fdata[i]; - sprintf( interp->result, "%f", max ); + sprintf( res, "%f", max ); + Tcl_SetResult( interp, res, TCL_VOLATILE ); return TCL_OK; } @@ -46,12 +48,14 @@ int PL_UNUSED( argc ), const char *PL_UNUSED( argv[] ) ) { PLFLT min = pm->fdata[0]; + char res[30]; int i; for ( i = 1; i < pm->len; i++ ) if ( pm->fdata[i] < min ) min = pm->fdata[i]; - sprintf( interp->result, "%f", min ); + sprintf( res, "%f", min ); + Tcl_SetResult( interp, res, TCL_VOLATILE ); return TCL_OK; } @@ -162,7 +166,7 @@ if ( pm->dim != 2 ) { - interp->result = "must use 2-d matrix."; + Tcl_SetResult( interp, (char *) "must use 2-d matrix.", TCL_STATIC ); return TCL_ERROR; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-08-23 20:18:48
|
Revision: 12226 http://plplot.svn.sourceforge.net/plplot/?rev=12226&view=rev Author: airwin Date: 2012-08-23 20:18:41 +0000 (Thu, 23 Aug 2012) Log Message: ----------- Add examples 0 and 33 to the examples that are executed by the "test_tk_standard_examples" target. Modified Paths: -------------- trunk/examples/tk/CMakeLists.txt trunk/examples/tk/tkdemos.tcl Modified: trunk/examples/tk/CMakeLists.txt =================================================================== --- trunk/examples/tk/CMakeLists.txt 2012-08-23 20:11:45 UTC (rev 12225) +++ trunk/examples/tk/CMakeLists.txt 2012-08-23 20:18:41 UTC (rev 12226) @@ -25,6 +25,7 @@ # BUILD_TEST ON and CORE_BUILD OFF. set(tk_STRING_INDICES + "00" "01" "02" "03" @@ -56,6 +57,7 @@ "29" "30" "31" + "33" ) set(tk_SRC_FILES Modified: trunk/examples/tk/tkdemos.tcl =================================================================== --- trunk/examples/tk/tkdemos.tcl 2012-08-23 20:11:45 UTC (rev 12225) +++ trunk/examples/tk/tkdemos.tcl 2012-08-23 20:18:41 UTC (rev 12226) @@ -46,27 +46,29 @@ plxframe .plw pack append . .plw {left expand fill} -for {set i 1} {$i <= 31} {incr i} { - set demo x[format "%02d" $i] +for {set i 0} {$i <= 33} {incr i} { + if {$i != 32} { + set demo x[format "%02d" $i] - # - # If the source code contains UTF-8 characters (beyond the - # ASCII-7 encoding), take special measures - # - - if { [lsearch $utf8_examples $i] < 0 } { - source $demo.tcl - } else { - sourceUtf8 $demo.tcl + # + # If the source code contains UTF-8 characters (beyond the + # ASCII-7 encoding), take special measures + # + + if { [lsearch $utf8_examples $i] < 0 } { + source $demo.tcl + } else { + sourceUtf8 $demo.tcl + } + + 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 + " } - - 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 - " } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <ai...@us...> - 2013-11-23 01:28:36
|
Revision: 12743 http://sourceforge.net/p/plplot/code/12743 Author: airwin Date: 2013-11-23 01:28:32 +0000 (Sat, 23 Nov 2013) Log Message: ----------- Simplify and better document our pause treatment Modified Paths: -------------- trunk/examples/tk/standard_examples.in trunk/examples/tk/tkdemos.tcl trunk/examples/tk/wish_standard_examples.in Modified: trunk/examples/tk/standard_examples.in =================================================================== --- trunk/examples/tk/standard_examples.in 2013-11-22 21:01:27 UTC (rev 12742) +++ trunk/examples/tk/standard_examples.in 2013-11-23 01:28:32 UTC (rev 12743) @@ -8,11 +8,11 @@ exec @plserver_LOCATION@ -f "$0" "$@" source tkdemos.tcl # -# Turn off pausing - it has to be done in two ways, as the plxframe uses a visual -# clue and bindings to key press events. +# Turn off pausing - Note in the current plserver case, the plxframe +# uses a visual clue and bindings to key press events so a different +# method must be used to disable pausing than in the wish case. # Note that the widget in question is .plw, not $plwin # -$plwin cmd plspause 0 plw::set_pause .plw 0 # # Now run the examples one by one Modified: trunk/examples/tk/tkdemos.tcl =================================================================== --- trunk/examples/tk/tkdemos.tcl 2013-11-22 21:01:27 UTC (rev 12742) +++ trunk/examples/tk/tkdemos.tcl 2013-11-23 01:28:32 UTC (rev 12743) @@ -91,8 +91,6 @@ proc $i {} " global plwin $demo $plwin - # Disable pausing (currently only does that for the wish version) - $plwin cmd plspause 0 $plwin cmd plcol0 1 $plwin cmd plsori 0 $plwin cmd plspal0 cmap0_default.pal Modified: trunk/examples/tk/wish_standard_examples.in =================================================================== --- trunk/examples/tk/wish_standard_examples.in 2013-11-22 21:01:27 UTC (rev 12742) +++ trunk/examples/tk/wish_standard_examples.in 2013-11-23 01:28:32 UTC (rev 12743) @@ -13,8 +13,8 @@ lappend auto_path @pkgIndex_LOCATION@ package require Pltk source tkdemos.tcl -# disable pauses -$plwin cmd plspause 0 +# Note wish currently disables pauses so no special method is +# required to do that (unlike the plserver case). 0 1 #2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |