From 2f175f552980bbfc86034e16a22987c37320a355 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 12 Dec 2018 05:49:28 -0600 Subject: [PATCH] Added an experiment (stage 1 of 3) --- src/controller/mainController.py | 1 + src/wxUI/mainWindow.py | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 9b8ee25..1f824f5 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -425,6 +425,7 @@ class Controller(object): r = self.session.vk.client.account.setOnline() except: log.error("Error in setting online for the current user") + self.window.notify("Socializer", "online now!") def set_offline(self): try: diff --git a/src/wxUI/mainWindow.py b/src/wxUI/mainWindow.py index 8a431e5..cae9361 100644 --- a/src/wxUI/mainWindow.py +++ b/src/wxUI/mainWindow.py @@ -2,6 +2,7 @@ import wx import wx.adv import application +from wx.lib.agw import toasterbox class mainWindow(wx.Frame): def makeMenu(self): @@ -125,8 +126,17 @@ class mainWindow(wx.Frame): self.tb.DeletePage(pos) def notify(self, title, text): - try: - self.notification = wx.adv.NotificationMessage(title, text, parent=self) - except AttributeError: - self.notification = wx.NotificationMessage(title, text) - self.notification.Show() \ No newline at end of file +# try: +# self.notification = wx.adv.NotificationMessage(title, text, parent=self) +# except AttributeError: +# self.notification = wx.NotificationMessage(title, text) +# self.notification.Show() + tbb= toasterbox.ToasterBox(self, toasterbox.TB_SIMPLE, windowstyle=toasterbox.TB_CAPTION, closingstyle=toasterbox.TB_ONTIME) + tbb.SetPopupSize((200, 100)) + tbb.SetPopupPauseTime(4000) + tbb.SetPopupPositionByInt(3) + tbb.SetPopupText(text) + tbb.SetTitle(title) + tbb.SetUseFocus(True) + print("Notifycation print") + wx.CallAfter(self.Play) \ No newline at end of file