ui.py

changeset 9
aa121291eb0e
parent 1
4cdc9c1f6b28
child 10
76dbfb06eba0
--- a/ui.py	Sat Jan 20 15:08:16 2018 +0000
+++ b/ui.py	Sat Jan 20 15:55:09 2018 +0000
@@ -5,6 +5,14 @@
 import rumps
 
 class BorgendTray(rumps.App):
-    @rumps.clicked("Status...")
-    def prefs(self, _):
-        rumps.alert("None")
+    def __init__(self, name, backups):
+        menu=[rumps.MenuItem(b.name, callback=self.silly) for b in backups]
+        menu = menu + [rumps.MenuItem("Quit...", callback=self.my_quit_button)]
+        super().__init__(name, menu=menu, quit_button=None)
+
+    def my_quit_button(self, _):
+        rumps.quit_application()
+
+    def silly(self, sender):
+        sender.state=not sender.state
+

mercurial