From 8365dd82c86724a0081a235de293f0021ca19d86 Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Sun, 14 Apr 2024 23:11:39 +0100 Subject: [PATCH] fix: ensure the closing of the window In case of unexpected error, it's often difficult to close the window. --- src/rstk_ext.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rstk_ext.rs b/src/rstk_ext.rs index 1e24b11..65a2e6e 100644 --- a/src/rstk_ext.rs +++ b/src/rstk_ext.rs @@ -1,8 +1,12 @@ use rstk::*; pub fn init_rstk_ext() { - // We create some useful tcl functions - rstk::tell_wish("chan configure stdin -encoding utf-8"); + rstk::tell_wish( + r#" + chan configure stdin -encoding utf-8 + wm protocol . WM_DELETE_WINDOW {destroy .}; + "#, + ); } #[derive(Clone, Debug, Default)]