From 0bba2dc3b39bdc75eaa8eaca84b83ccfa650d7ac Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Fri, 24 Oct 2025 10:27:48 -0400 Subject: [PATCH] Fix modal file browser. --- scripts/tkremind.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/tkremind.in b/scripts/tkremind.in index 68f7674d..61f8fd2e 100644 --- a/scripts/tkremind.in +++ b/scripts/tkremind.in @@ -1628,7 +1628,14 @@ proc DoPrintHelper {} { # Arguments: none #--------------------------------------------------------------------------- proc PrintFileBrowse {} { - set ans [BrowseForFile .filebrowse "Print to file..." "Ok" 0 "*.ps"] + global Option + if { $Option(PrintFormat) == "pdf" } { + set pattern "*.pdf" + } else { + set pattern "*.ps" + } + + set ans [BrowseForFile .filebrowse "Print to file..." "Ok" 0 $pattern] if {$ans != ""} { .p.filename delete 0 end .p.filename insert end $ans @@ -2778,6 +2785,7 @@ proc BrowseForFile {w title {oktext "OK"} {showdots 0} {filter "*"}} { # Fill in the box and wait for status to change BrowseForFileRead $w [pwd] + bind $w "catch { raise .p } ; raise $w" bind $w "$w.cancel flash; $w.cancel invoke" bind $w.list "$w.entry delete 0 end; $w.entry insert 0 \[selection get\]" bind $w.list "$w.ok flash; $w.ok invoke" @@ -2788,6 +2796,7 @@ proc BrowseForFile {w title {oktext "OK"} {showdots 0} {filter "*"}} { bind $w.entry "ExpandFile $w" bindtags $w.entry "Entry $w.entry $w all" + wm protocol $w WM_DELETE_WINDOW "$w.cancel flash; $w.cancel invoke" bindtags $w.list "Listbox $w.list $w all" CenterWindow $w . set oldFocus [focus]