From fe55eb11f88a72d3a31d25dcf8137f135ba10bf9 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 22 Nov 2021 10:57:46 +0000 Subject: [PATCH] click_counter: Cast value to int() for saving --- docs/examples/click_counter/load.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/examples/click_counter/load.py b/docs/examples/click_counter/load.py index fd402866..776e9d4b 100644 --- a/docs/examples/click_counter/load.py +++ b/docs/examples/click_counter/load.py @@ -77,7 +77,9 @@ class ClickCounter: :param cmdr: The current ED Commander :param is_beta: Whether or not EDMC is currently marked as in beta mode """ - config.set('click_counter_count', self.click_count.get()) # type: ignore + # You need to cast to `int` here to store *as* an `int`, so that + # `config.get_int()` will work for re-loading the value. + config.set('click_counter_count', int(self.click_count.get())) # type: ignore def setup_main_ui(self, parent: tk.Frame) -> tk.Frame: """