Skip to content

Commit c5e2dd4

Browse files
committed
consistent error, close window
1 parent c9e9dfe commit c5e2dd4

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

vmdplumed.tcl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,8 +2167,6 @@ proc ::Plumed::show_forces_compute { } {
21672167
# Parse if v2
21682168
if { $failure } {
21692169
puts "Something went wrong. Check above messages."
2170-
tk_messageBox -icon error -title "Error" -parent .plumed -message \
2171-
"PLUMED returned an error while executing the script. Please find error messages in the console. "
21722170
return {}
21732171
}
21742172

@@ -2240,19 +2238,23 @@ proc ::Plumed::show_forces_gui {} {
22402238

22412239
set show_forces_data [show_forces_compute]
22422240

2243-
if [show_forces_is_null $show_forces_data] {
2241+
if {$show_forces_data eq ""} {
2242+
tk_messageBox -icon error \
2243+
-title "Error" \
2244+
-message "PLUMED returned an error while executing the script. Please find error messages in the console. " \
2245+
-parent .plumed_show_forces
2246+
show_forces_stop
2247+
destroy .plumed_show_forces
2248+
} elseif [show_forces_is_null $show_forces_data] {
22442249
tk_messageBox -icon info \
22452250
-message "All acting forces are null. Consider adding a RESTRAINT or another biasing statement." \
22462251
-title "Null forces" \
22472252
-parent .plumed_show_forces
2248-
set show_forces_data {}
2249-
}
2250-
2251-
if {$show_forces_data ne ""} {
2253+
show_forces_stop
2254+
destroy .plumed_show_forces
2255+
} else {
22522256
show_forces_start
22532257
show_forces_draw_frame
2254-
} else {
2255-
show_forces_stop
22562258
}
22572259
}
22582260

0 commit comments

Comments
 (0)