-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsample.py
26 lines (19 loc) · 866 Bytes
/
sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QGridLayout
from pyqt_toast import Toast
class ToastExample(QWidget):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
self.__toast = Toast(text='The Krabby Patty formula is the sole property of the Krusty Krab and is only to be discussed in part or in whole with its creator Mr. Krabs. Duplication of this formula is punishable by law. Restrictions apply, results may vary.', duration=3, parent=self)
btn = QPushButton('Krabby Patty secret formula')
btn.clicked.connect(self.__toast.show)
lay = QGridLayout()
lay.addWidget(btn)
self.setLayout(lay)
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
toastExample = ToastExample()
toastExample.show()
app.exec_()