-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
18 additions
and
45 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ tksheet==6.2.9 | |
icecream==2.1.3 | ||
plyer==2.1.0 | ||
playsound==1.3.0 | ||
desktop-notifier==3.5.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
import tkinter as tk | ||
from tksheet import Sheet | ||
import asyncio | ||
from desktop_notifier import DesktopNotifier | ||
|
||
notifier = DesktopNotifier() | ||
|
||
class demo(tk.Tk): | ||
def __init__(self): | ||
tk.Tk.__init__(self) | ||
self.grid_columnconfigure(0, weight = 1) | ||
self.grid_rowconfigure(0, weight = 1) | ||
self.frame = tk.Frame(self) | ||
self.frame.grid_columnconfigure(0, weight = 1) | ||
self.frame.grid_rowconfigure(0, weight = 1) | ||
self.sheet = Sheet(self.frame, | ||
data = [ | ||
[ | ||
f"Row {r}, Column {c}\nnewline1\nnewline2" | ||
for c in range(50) | ||
] | ||
for r in range(500) | ||
] | ||
) | ||
self.sheet.enable_bindings() | ||
self.frame.grid(row = 0, column = 0, sticky = "nswe") | ||
self.sheet.grid(row = 0, column = 0, sticky = "nswe") | ||
async def main(): | ||
n = await notifier.send(title="Hello world!", message="Sent from Python") | ||
await asyncio.sleep(5) # wait a bit before clearing notification | ||
await notifier.clear(n) # removes the notification | ||
await notifier.clear_all() # removes all notifications for this app | ||
|
||
|
||
app = demo() | ||
app.mainloop() | ||
asyncio.run(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters