diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-03-27 15:59:05 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-03-27 15:59:05 (GMT) |
commit | 6cbd586d1439b7189e3349533ded31de37a2da43 (patch) | |
tree | 5da8091542ecd9ad7048d5f1d16afa82ad9354fe /ds9 | |
parent | e59c06603d7488904582b21295cdaca0cbd373f3 (diff) | |
download | blt-6cbd586d1439b7189e3349533ded31de37a2da43.zip blt-6cbd586d1439b7189e3349533ded31de37a2da43.tar.gz blt-6cbd586d1439b7189e3349533ded31de37a2da43.tar.bz2 |
macosx print
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/macosx.tcl | 70 | ||||
-rw-r--r-- | ds9/library/mfile.tcl | 38 | ||||
-rw-r--r-- | ds9/library/plotdialog.tcl | 7 |
3 files changed, 63 insertions, 52 deletions
diff --git a/ds9/library/macosx.tcl b/ds9/library/macosx.tcl index 782f11d..4f45ccc 100644 --- a/ds9/library/macosx.tcl +++ b/ds9/library/macosx.tcl @@ -46,37 +46,43 @@ proc MacOSXGetLocale {} { return [macosx locale] } -#proc MacOSXPrint {} { -# global ds9 -# +proc MacOSXPrint {} { + global ds9 + # we need to be realized -# RealizeDS9 + RealizeDS9 # need the colorbar levels updated -# UpdateColormapLevel -# -# if {[macosx pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] yes]} { -# foreach f $ds9(frames) { -# $f macosx print -# } -# colorbar macosx print -# colorbarrgb macosx print -# macosx pm print end -# } -#} - -#proc MacOSXPrintPre {} { -# global ds9 - -# if {[macosx pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] no]} { -# foreach f $ds9(frames) { -# $f macosx print -# } -# colorbar macosx print -# colorbarrgb macosx print -# macosx pm print end -# } -#} - -#proc MacOSXPageSetup {} { -# macosx pm pagesetup -#} + UpdateColormapLevel + + if {[catch {macosx pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] yes}]} { + Error "bad" + } else { + Info "good" + } + + if {0} { + foreach f $ds9(frames) { + $f macosx print + } + colorbar macosx print + colorbarrgb macosx print + macosx pm print end + } +} + +proc MacOSXPrintPre {} { + global ds9 + + if {[macosx pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] no]} { + foreach f $ds9(frames) { + $f macosx print + } + colorbar macosx print + colorbarrgb macosx print + macosx pm print end + } +} + +proc MacOSXPageSetup {} { + macosx pm pagesetup +} diff --git a/ds9/library/mfile.tcl b/ds9/library/mfile.tcl index 83f0629..0f8c949 100644 --- a/ds9/library/mfile.tcl +++ b/ds9/library/mfile.tcl @@ -60,15 +60,19 @@ proc FileMainMenu {} { } aqua { # accelerators don't work with dialog box - $ds9(mb).file add command -label "[msgcat::mc {Page Setup}]..." \ + $ds9(mb).file add command \ + -label "[msgcat::mc {Postscript Page Setup}]..." \ -command PSPageSetup - $ds9(mb).file add command -label "[msgcat::mc {Print}]..." \ + $ds9(mb).file add command \ + -label "[msgcat::mc {Postscript Print}]..." \ -command PSPrint -# $ds9(mb).file add command -label "[msgcat::mc {Postscript Page Setup}]..." -command PSPageSetup -# $ds9(mb).file add command -label "[msgcat::mc {Postscript Print}]..." -command PSPrint -# $ds9(mb).file add separator -# $ds9(mb).file add command -label "[msgcat::mc {Page Setup}]..." -command MacOSXPageSetup -# $ds9(mb).file add command -label "[msgcat::mc {Print}]..." -command MacOSXPrint + $ds9(mb).file add separator + $ds9(mb).file add command \ + -label "[msgcat::mc {Page Setup}]..." \ + -command MacOSXPageSetup + $ds9(mb).file add command \ + -label "[msgcat::mc {Print}]..." \ + -command MacOSXPrint } } switch $ds9(wm) { @@ -367,11 +371,9 @@ proc CreateButtonsFile {} { } aqua { ButtonButton $ds9(buttons).file.page \ - [string tolower [msgcat::mc {Page Setup}]] PSPageSetup + [string tolower [msgcat::mc {Page Setup}]] MacOSXPageSetup ButtonButton $ds9(buttons).file.print \ - [string tolower [msgcat::mc {Print}]] PSPrint -# ButtonButton $ds9(buttons).file.page [string tolower [msgcat::mc {Page Setup}]] MacOSXPageSetup -# ButtonButton $ds9(buttons).file.print [string tolower [msgcat::mc {Print}]] MacOSXPrint + [string tolower [msgcat::mc {Print}]] MacOSXPrint } } @@ -446,6 +448,15 @@ proc PrefsDialogButtonbarFile {f} { } aqua { $m add checkbutton \ + -label "[msgcat::mc {Postscript Page Setup}]..." \ + -variable pbuttons(file,pspage) \ + -command {UpdateButtons buttons(file)} + $m add checkbutton \ + -label "[msgcat::mc {Postscript Print}]..." \ + -variable pbuttons(file,psprint) \ + -command {UpdateButtons buttons(file)} + $m add separator + $m add checkbutton \ -label "[msgcat::mc {Page Setup}]..." \ -variable pbuttons(file,page) \ -command {UpdateButtons buttons(file)} @@ -453,11 +464,6 @@ proc PrefsDialogButtonbarFile {f} { -label "[msgcat::mc {Print}]..." \ -variable pbuttons(file,print) \ -command {UpdateButtons buttons(file)} -# $m add checkbutton -label "[msgcat::mc {Postscript Page Setup}]..." -variable pbuttons(file,pspage) -command {UpdateButtons buttons(file)} -# $m add checkbutton -label "[msgcat::mc {Postscript Print}]..." -variable pbuttons(file,psprint) -command {UpdateButtons buttons(file)} -# $m add separator -# $m add checkbutton -label "[msgcat::mc {Page Setup}]..." -variable pbuttons(file,page) -command {UpdateButtons buttons(file)} -# $m add checkbutton -label "[msgcat::mc {Print}]..." -variable pbuttons(file,print) -command {UpdateButtons buttons(file)} } } diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl index 8c6fccb..e45482e 100644 --- a/ds9/library/plotdialog.tcl +++ b/ds9/library/plotdialog.tcl @@ -86,12 +86,11 @@ proc PlotDialog {varname wtt title xaxis yaxis} { } aqua { $var(mb).file add command \ - -label "[msgcat::mc {Page Setup}]..." \ + -label "[msgcat::mc {Postscript Page Setup}]..." \ -command PSPageSetup - $var(mb).file add command -label "[msgcat::mc {Print}]..." \ + $var(mb).file add command \ + -label "[msgcat::mc {Postscript Print}]..." \ -command [list PlotPSPrint $varname] -# $var(mb).file add command -label "[msgcat::mc {Postscript Page Setup}]..." -command PSPageSetup -# $var(mb).file add command -label "[msgcat::mc {Postscript Print}]..." -command [list PlotPSPrint $varname] } } $var(mb).file add separator |