Message clicked events returned
This commit is contained in:
parent
cd1327e1e2
commit
bca3fd18ee
|
@ -2704,6 +2704,8 @@ class SystemTray:
|
|||
if self.Tooltip is not None:
|
||||
self.TrayIcon.setToolTip(str(self.Tooltip))
|
||||
|
||||
self.TrayIcon.messageClicked.connect(self.messageClicked)
|
||||
|
||||
self.TrayIcon.setContextMenu(qmenu)
|
||||
|
||||
|
||||
|
@ -2711,6 +2713,11 @@ class SystemTray:
|
|||
self.MenuItemChosen = item_chosen.replace('&','')
|
||||
self.App.exit() # kick the users out of the mainloop
|
||||
|
||||
# callback function when message is clicked
|
||||
def messageClicked(self):
|
||||
self.MenuItemChosen = '_MESSAGE_CLICKED_'
|
||||
self.App.exit()
|
||||
|
||||
|
||||
def Read(self, timeout=None):
|
||||
'''
|
||||
|
@ -2732,12 +2739,15 @@ class SystemTray:
|
|||
self.MenuItemChosen = None
|
||||
return item
|
||||
|
||||
|
||||
def Hide(self):
|
||||
self.TrayIcon.hide()
|
||||
|
||||
|
||||
def UnHide(self):
|
||||
self.TrayIcon.show()
|
||||
|
||||
|
||||
def ShowMessage(self, title, message, filename=None, data=None, data_base64=None, time=10000):
|
||||
'''
|
||||
Shows a balloon above icon in system tray
|
||||
|
|
Loading…
Reference in New Issue