Raise windows after errors so they remain visible.

This commit is contained in:
Dianne Skoll
2024-03-21 16:08:18 -04:00
parent 30d9a42db2
commit 2afa3c5558

View File

@@ -1511,6 +1511,7 @@ proc PrintFileBrowse {} {
.p.filename icursor end .p.filename icursor end
.p.filename xview end .p.filename xview end
} }
raise .p
} }
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -1563,10 +1564,12 @@ proc DoGoto {} {
set year [.g.y.e get] set year [.g.y.e get]
if { ! [regexp {^[0-9]+$} $year] } { if { ! [regexp {^[0-9]+$} $year] } {
show_error {Illegal year specified (1990-5990)} show_error {Illegal year specified (1990-5990)}
raise .g
return return
} }
if { $year < 1990 || $year > 5990 } { if { $year < 1990 || $year > 5990 } {
show_error {Illegal year specified (1990-5990)} show_error {Illegal year specified (1990-5990)}
raise .g
return return
} }
set month [lsearch -exact $MonthNames [.g.mon cget -text]] set month [lsearch -exact $MonthNames [.g.mon cget -text]]
@@ -2046,6 +2049,7 @@ proc ModifyDay {d firstDay} {
set problem [catch {set rem [CreateReminder .mod]} err] set problem [catch {set rem [CreateReminder .mod]} err]
if {$problem} { if {$problem} {
show_error $err show_error $err
raise .mod
} else { } else {
if {$ModifyDialogResult == 3} { if {$ModifyDialogResult == 3} {
set rem [EditReminder $rem Cancel "Add reminder"] set rem [EditReminder $rem Cancel "Add reminder"]
@@ -2585,8 +2589,9 @@ proc BrowseForFileRead {w {dir ""}} {
if {$dir == ""} { if {$dir == ""} {
set dir [$w.cwd cget -text] set dir [$w.cwd cget -text]
} }
if {[catch "cd $dir" err]} { if {[catch {cd $dir} err]} {
show_error "$err" show_error "$err"
raise $w
return return
} }
$w.cwd configure -text [pwd] $w.cwd configure -text [pwd]