first commit
This commit is contained in:
23
pyradiotray.py
Normal file
23
pyradiotray.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from PyQt6.QtGui import QIcon, QAction
|
||||
from PyQt6.QtWidgets import QApplication, QMenu, QSystemTrayIcon
|
||||
app = QApplication([])
|
||||
app.setQuitOnLastWindowClosed(False)
|
||||
# Adding an icon
|
||||
icon = QIcon("radio.png")
|
||||
# Adding item on the menu bar
|
||||
tray = QSystemTrayIcon()
|
||||
tray.setIcon(icon)
|
||||
tray.setVisible(True)
|
||||
# Creating the options
|
||||
menu = QMenu()
|
||||
option1 = QAction("Geeks for Geeks")
|
||||
option2 = QAction("GFG")
|
||||
menu.addAction(option1)
|
||||
menu.addAction(option2)
|
||||
# To quit the app
|
||||
quit = QAction("Quit")
|
||||
quit.triggered.connect(app.quit)
|
||||
menu.addAction(quit)
|
||||
# Adding options to the System Tray
|
||||
tray.setContextMenu(menu)
|
||||
app.exec()
|
||||
Reference in New Issue
Block a user