From 6059dab7ce4d60d9fcdc4d40c3571dba8a3a38ca Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Sun, 14 Apr 2024 23:43:49 +0100 Subject: [PATCH] fix: ensure the closing of the window (#63) 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 d07c5d4..fb5d55d 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)]