Skip to content

Windows10-like ToastNotification written in tkinter

Notifications You must be signed in to change notification settings

kaifhm/tkNotification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tkNotification

Windows10-like ToastNotification written in tkinter

A class that simulates Windows 10's Toast Notification

Preview

Preview

Parameters

title: string -> Title of the notification. If you don't want a title just pass an empty string

message: string -> Body of the notification

icon_path: string -> Path to the icon to be displayed. .ico files are not recommended. The image will be resized to a smaller image of 1:1 ratio

buttons: list -> List of tuples containing 2 elements

  • [0] element is text to be displayed on button
  • [1] element is function to be called on click

timeout: int -> seconds before the notification vanishes

Example

def ok():
    print('ok')


def cancel():
    print('cancel')


def close():
    print('close')

notification = Notification('Battery', 'Battery has been sufficiently charged.',
                 'path to icon', [
                     ('OK', ok), ('Cancel', cancel), ('Close', close)])
notification.notify()

Issues

  • Does not play a sound

About

Windows10-like ToastNotification written in tkinter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages