diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-07-21 16:00:33 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-07-21 16:00:33 (GMT) |
commit | e1a0f81dbfcd8f731d436b3ea1bf865bc9cb6b57 (patch) | |
tree | 3ff3d276246f4dcf8ca1c525d1a8ec61ba991339 /ds9 | |
parent | e0fea673f3b39d00beae3211c82fbd0309546bc8 (diff) | |
download | blt-e1a0f81dbfcd8f731d436b3ea1bf865bc9cb6b57.zip blt-e1a0f81dbfcd8f731d436b3ea1bf865bc9cb6b57.tar.gz blt-e1a0f81dbfcd8f731d436b3ea1bf865bc9cb6b57.tar.bz2 |
support multiple graphs per plot
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/plot.tcl | 26 | ||||
-rw-r--r-- | ds9/library/plotdialog.tcl | 18 |
2 files changed, 23 insertions, 21 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index ce1155e..6cf6d25 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -159,7 +159,7 @@ proc PlotAddGraph {varname} { $var(proc,updategraph) $varname $var(proc,updatecanvas) $varname - PlotBuildDataSetMenu $varname + PlotUpdateDataSetMenu $varname PlotStats $varname PlotList $varname @@ -235,7 +235,7 @@ proc PlotDeleteGraph {varname} { PlotLayoutCanvas $varname - PlotBuildDataSetMenu $varname + PlotUpdateDataSetMenu $varname PlotStats $varname PlotList $varname @@ -265,7 +265,7 @@ proc PlotAddElement {varname} { # update menus $var(proc,updateelement) $varname - PlotBuildDataSetMenu $varname + PlotUpdateDataSetMenu $varname PlotStats $varname PlotList $varname @@ -342,28 +342,12 @@ proc PlotDeleteDataSet {varname} { # update menus $var(proc,updateelement) $varname - PlotBuildDataSetMenu $varname + PlotUpdateDataSetMenu $varname PlotStats $varname PlotList $varname } -proc PlotBuildDataSetMenu {varname} { - upvar #0 $varname var - global $varname - - # remove menu item - $var(mb).graph.select delete 0 end - - # create menu item - set cc $var(graph,current) - foreach nn $var(graph,dss) { - $var(mb).graph.select add radiobutton -label "$var($cc,$nn,name)" \ - -variable ${varname}(graph,ds,current) -value $nn \ - -command [list PlotCurrentDataSet $varname] - } -} - proc PlotCurrentGraph {varname} { upvar #0 $varname var global $varname @@ -374,7 +358,7 @@ proc PlotCurrentGraph {varname} { PlotRestoreState $varname - PlotBuildDataSetMenu $varname + PlotUpdateDataSetMenu $varname PlotStats $varname PlotList $varname diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl index e5a8653..cc7f193 100644 --- a/ds9/library/plotdialog.tcl +++ b/ds9/library/plotdialog.tcl @@ -669,3 +669,21 @@ proc PlotExport {varname fn format} { # reset if needed DarwinPhotoRestore $var(top) $geom } + +proc PlotUpdateDataSetMenu {varname} { + upvar #0 $varname var + global $varname + + # remove menu item + $var(mb).graph.select delete 0 end + + # create menu item + set cc $var(graph,current) + foreach nn $var(graph,dss) { + $var(mb).graph.select add radiobutton -label "$var($cc,$nn,name)" \ + -variable ${varname}(graph,ds,current) -value $nn \ + -command [list PlotCurrentDataSet $varname] + } +} + + |