Pyloid Docs
GithubLanguage
  • 💎What is Pyloid?
  • Getting Started
    • Prerequisites
    • Create Pyloid App
  • Core Concepts
    • Thread Safety
  • API
    • Python (Backend)
      • Pyloid
      • BrowserWindow
      • Monitor
      • TrayEvent
      • Utility Functions
      • RPC
      • Store
    • Javascript (Frontend)
      • Event
      • BaseAPI
      • RPC
  • Guides
    • Load Webview
    • Serve Frontend
    • Calling Python from JS
    • Calling JS from Python
    • Keyboard Shotcuts
    • Notification
    • Tray
    • Timer
    • File Watcher
    • Clipboard
    • Window Position
    • Devtools
    • Window Drag Region
    • Window Radius And Transparent
    • Autostart
    • Production Utils
    • Desktop Monitor
    • File Dialog
    • Splash Screen
Powered by GitBook
On this page
  • Usage
  • Parameters
  • Example
  • Setting a Notification Click Callback
  • Usage
  • Parameters
  • Example

Was this helpful?

Edit on GitHub
  1. Guides

Notification

You can display notifications to users using the show_notification() method of Pyloid.

Usage

app.show_notification(title, message)

Parameters

  • title (string): The title of the notification

  • message (string): The content of the notification message

Example

app.show_notification("Notification", "Notification message")

This code displays a notification with the title "Notification" and the content "Notification message".

Setting a Notification Click Callback

You can set a callback function to be executed when a notification is clicked.

Usage

app.set_notification_callback(callback_function)

Parameters

  • callback_function (function): The function to be executed when the notification is clicked

Example

def on_notification_clicked():
    print("The notification was clicked!")

app.set_notification_callback(on_notification_clicked)

# Display a new notification
app.show_notification("New Notification", "Click this notification!")

This code sets up a notification click callback and displays a new notification. When the user clicks the notification, the message "The notification was clicked!" will be printed.

PreviousKeyboard ShotcutsNextTray

Last updated 7 months ago

Was this helpful?