summaryrefslogtreecommitdiffstats
path: root/library/print.tcl
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2021-07-19 12:23:07 (GMT)
committerKevin Walzer <kw@codebykevin.com>2021-07-19 12:23:07 (GMT)
commit2663ec07e3687fa6a29ecda78ef1cfe984eddd75 (patch)
tree1d7f00c23d92c03dc5a0c56b2b31b30e7ceaaec6 /library/print.tcl
parent58c629a953ccf1bdfee92168437500af882db671 (diff)
downloadtk-2663ec07e3687fa6a29ecda78ef1cfe984eddd75.zip
tk-2663ec07e3687fa6a29ecda78ef1cfe984eddd75.tar.gz
tk-2663ec07e3687fa6a29ecda78ef1cfe984eddd75.tar.bz2
Display print dialog only once, not twice
Diffstat (limited to 'library/print.tcl')
-rw-r--r--library/print.tcl9
1 files changed, 2 insertions, 7 deletions
diff --git a/library/print.tcl b/library/print.tcl
index 2a48ae4..51b91c1 100644
--- a/library/print.tcl
+++ b/library/print.tcl
@@ -59,20 +59,14 @@ namespace eval ::tk::print {
variable dpi_x
variable dpi_y
variable copies
-
- set printer_name ""
#First, we select the printer.
_selectprinter
- if {$printer_name eq ""} {
- #they pressed cancel
- return
- }
-
#Next, set values. Some are taken from the printer,
#some are sane defaults.
+ if {[info exists printer_name] && $printer_name ne ""} {
set printargs(hDC) $printer_name
set printargs(pw) $paper_width
set printargs(pl) $paper_height
@@ -84,6 +78,7 @@ namespace eval ::tk::print {
set printargs(resy) $dpi_y
set printargs(copies) $copies
set printargs(resolution) [list $dpi_x $dpi_y]
+ }
}
# _print_data