mo-dabao / winsdk_toast Goto Github PK
View Code? Open in Web Editor NEWA simple package for displaying Windows Toast Notification based on winsdk.
License: MIT License
A simple package for displaying Windows Toast Notification based on winsdk.
License: MIT License
如图所示, 点击了 1 2 3 4 过后 handle_activated 返回结果都是一样的
def testToast():
# Step1. Create Notifier with applicationId
notifier = Notifier('MQTT 消息通知')
# Step2. Create Toast which contains the message to be shown
toast = Toast()
toast.add_text('第一行 1st line', hint_align='center', hint_style='caption')
toast.add_text('第二行 2nd line')
toast.add_text('第三行 3rd line', placement='attribution')
# toast.add_image(path_pic, placement='appLogoOverride')
# toast.add_input(type_='selection', id_='input_name')
toast.add_action('1', hint_inputId='1')
toast.add_action('2')
toast.add_action('3')
toast.add_action('4')
toast.set_audio(silent='true') # Mute
# Step3. Show the Toast
notifier.show(toast, handle_activated=notifyActiveHandler, handle_dismissed=handle_dismissed)
def notifyActiveHandler(event_args_activated: EventArgsActivated):
print('activated')
print('inputs:', event_args_activated.inputs)
event_args_activated.sender
print('argument:', event_args_activated.argument)
def handle_dismissed(event_args_dismissed: EventArgsDismissed):
print('dismissed')
print('reason:', event_args_dismissed.reason)
如题
信息窗口的持续时间能不能修改?
顺便问一下这个包对于老版本Windows是否支持?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.