From 55387cfb3a63729675622726bb3655262569ea58 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sun, 2 Dec 2018 19:09:08 -0500 Subject: [PATCH] Save Last Message and Last Title shown in system tray --- PySimpleGUIQt/PySimpleGUIQt.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index b21fa545..611eb64e 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -2738,6 +2738,8 @@ class SystemTray: self.TrayIcon = None self.Shown = False self.MenuItemChosen = TIMEOUT_KEY + self.LastMessage = None + self.LastTitle = None global _my_windows @@ -2797,6 +2799,7 @@ class SystemTray: self.MenuItemChosen = EVENT_SYSTEM_TRAY_ICON_ACTIVATED self.App.exit() + def Read(self, timeout=None): ''' Reads the context menu @@ -2863,6 +2866,8 @@ class SystemTray: else: self.TrayIcon.showMessage(title, message, time) + self.LastMessage = message + self.LastTitle = title return self def Close(self):