From f4a302585608ea738769a5ea3b83577723989a2a Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 2 Mar 2018 17:18:12 -0500 Subject: fix -close issue if no -open first --- ds9/library/bin.tcl | 3 +-- ds9/library/block.tcl | 3 +-- ds9/library/colorbar.tcl | 3 +-- ds9/library/command.tcl | 11 +++++++++-- ds9/library/contour.tcl | 3 +-- ds9/library/crop.tcl | 3 +-- ds9/library/crosshair.tcl | 3 +-- ds9/library/cube.tcl | 3 +-- ds9/library/graph.tcl | 3 +-- ds9/library/panzoom.tcl | 12 ++++++------ ds9/library/pixel.tcl | 3 --- ds9/library/scale.tcl | 5 ++--- ds9/library/wcs.tcl | 3 +-- 13 files changed, 26 insertions(+), 32 deletions(-) diff --git a/ds9/library/bin.tcl b/ds9/library/bin.tcl index 93ab74a..b527f3b 100644 --- a/ds9/library/bin.tcl +++ b/ds9/library/bin.tcl @@ -631,9 +631,8 @@ proc BinDestroyDialog {} { if {[winfo exists $ibin(top)]} { destroy $ibin(top) destroy $ibin(mb) + unset dbin } - - unset dbin } proc MatchBinCurrent {} { diff --git a/ds9/library/block.tcl b/ds9/library/block.tcl index f729e28..d4135f8 100644 --- a/ds9/library/block.tcl +++ b/ds9/library/block.tcl @@ -179,9 +179,8 @@ proc BlockDestroyDialog {} { if {[winfo exists $iblock(top)]} { destroy $iblock(top) destroy $iblock(mb) + unset dblock } - - unset dblock } proc UpdateBlockDialog {} { diff --git a/ds9/library/colorbar.tcl b/ds9/library/colorbar.tcl index ad80cc5..1a5bd67 100644 --- a/ds9/library/colorbar.tcl +++ b/ds9/library/colorbar.tcl @@ -912,9 +912,8 @@ proc ColormapDestroyDialog {} { if {[winfo exists $icolorbar(top)]} { destroy $icolorbar(top) destroy $icolorbar(mb) + unset dcolorbar } - - unset dcolorbar } proc ApplyColormap {} { diff --git a/ds9/library/command.tcl b/ds9/library/command.tcl index 2e43f90..bb8d476 100644 --- a/ds9/library/command.tcl +++ b/ds9/library/command.tcl @@ -279,7 +279,12 @@ proc ProcessCommand {argv argc} { -orient {incr i; ProcessOrientCmd argv i} -pagesetup {incr i; ProcessPageSetupCmd argv i} -pspagesetup {incr i; ProcessPSPageSetupCmd argv i} - -pan {incr i; ProcessPanCmd argv i} + -pan { + incr i + if {[ProcessPanCmd argv i] != 0} { + return; + } + } -panner { # backward compatibility set view(panner) 1 @@ -452,7 +457,9 @@ proc ProcessCommand {argv argc} { -zmax {set scale(mode) zmax; ChangeScaleMode} -zoom { incr i; - ProcessZoomCmd argv i + if {[ProcessZoomCmd argv i] != 0} { + return; + } } default { diff --git a/ds9/library/contour.tcl b/ds9/library/contour.tcl index cdbb61a..8fd8468 100644 --- a/ds9/library/contour.tcl +++ b/ds9/library/contour.tcl @@ -336,9 +336,8 @@ proc ContourDestroyDialog {} { if {[winfo exists $icontour(top)]} { destroy $icontour(top) destroy $icontour(mb) + unset dcontour } - - unset dcontour } proc ContourGenerateDialog {} { diff --git a/ds9/library/crop.tcl b/ds9/library/crop.tcl index 8011954..f2e0fbc 100644 --- a/ds9/library/crop.tcl +++ b/ds9/library/crop.tcl @@ -181,9 +181,8 @@ proc CropDestroyDialog {} { if {[winfo exists $icrop(top)]} { destroy $icrop(top) destroy $icrop(mb) + unset dcrop } - - unset dcrop } proc UpdateCropMenu {} { diff --git a/ds9/library/crosshair.tcl b/ds9/library/crosshair.tcl index 3ed1b24..453bc4d 100644 --- a/ds9/library/crosshair.tcl +++ b/ds9/library/crosshair.tcl @@ -213,9 +213,8 @@ proc CrosshairDestroyDialog {} { if {[winfo exists $icrosshair(top)]} { destroy $icrosshair(top) destroy $icrosshair(mb) + unset dcrosshair } - - unset dcrosshair } proc UpdateCrosshairDialog {} { diff --git a/ds9/library/cube.tcl b/ds9/library/cube.tcl index e29e7a8..dec7868 100644 --- a/ds9/library/cube.tcl +++ b/ds9/library/cube.tcl @@ -429,9 +429,8 @@ proc CubeDestroyDialog {} { if {[winfo exists $icube(top)]} { destroy $icube(top) destroy $icube(mb) + unset dcube } - - unset dcube } proc UpdateCubeMenu {} { diff --git a/ds9/library/graph.tcl b/ds9/library/graph.tcl index cd32287..edf88e4 100644 --- a/ds9/library/graph.tcl +++ b/ds9/library/graph.tcl @@ -555,8 +555,7 @@ proc GraphDestroyDialog {} { if {[winfo exists $igraph(top)]} { destroy $igraph(top) destroy $igraph(mb) + unset dgraph } - - unset dgraph } diff --git a/ds9/library/panzoom.tcl b/ds9/library/panzoom.tcl index 9d9f77d..1a1d84b 100644 --- a/ds9/library/panzoom.tcl +++ b/ds9/library/panzoom.tcl @@ -508,9 +508,8 @@ proc PanZoomDestroyDialog {} { if {[winfo exists $ipanzoom(top)]} { destroy $ipanzoom(top) destroy $ipanzoom(mb) + unset dpanzoom } - - unset dpanzoom } proc UpdatePanZoomMenu {} { @@ -680,15 +679,16 @@ proc PanZoomBackup {ch which} { proc ProcessPanCmd {varname iname} { upvar $varname var - upvar $iname i + upvar $iname ii # we need to be realized ProcessRealizeDS9 pan::YY_FLUSH_BUFFER - pan::yy_scan_string [lrange $var $i end] - pan::yyparse - incr i [expr $pan::yycnt-1] + pan::yy_scan_string [lrange $var $ii end] + set rr [pan::yyparse] + incr ii [expr $pan::yycnt-1] + return $rr } proc oProcessPanCmd {varname iname} { diff --git a/ds9/library/pixel.tcl b/ds9/library/pixel.tcl index c16d1ae..594bab0 100644 --- a/ds9/library/pixel.tcl +++ b/ds9/library/pixel.tcl @@ -122,9 +122,6 @@ proc PixelTableDestroyDialog {} { if {[winfo exists $ipixel(top)]} { destroy $ipixel(top) destroy $ipixel(mb) - } - - if {[info exists dpixel]} { unset dpixel } } diff --git a/ds9/library/scale.tcl b/ds9/library/scale.tcl index a890329..f744150 100644 --- a/ds9/library/scale.tcl +++ b/ds9/library/scale.tcl @@ -393,10 +393,9 @@ proc ScaleDestroyDialog {} { if {[winfo exists $iscale(top)]} { destroy $iscale(top) destroy $iscale(mb) + unset dscale + blt::vector destroy $dscale(xdata) $dscale(ydata) } - - blt::vector destroy $dscale(xdata) $dscale(ydata) - unset dscale } proc ScaleMotionDialog {x y varname} { diff --git a/ds9/library/wcs.tcl b/ds9/library/wcs.tcl index 2a98b6a..cab8e42 100644 --- a/ds9/library/wcs.tcl +++ b/ds9/library/wcs.tcl @@ -440,9 +440,8 @@ proc WCSDestroyDialog {} { if {[winfo exists $iwcs(top)]} { destroy $iwcs(top) destroy $iwcs(mb) + unset dwcs } - - unset dwcs } proc WCSSaveDialog {} { -- cgit v0.12