-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabout.py
30 lines (24 loc) · 947 Bytes
/
about.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
27
28
29
30
"""
MQTT Client GUI - About Window
Author: Sahin MERSIN - electrocoder <[email protected]>
"""
import os
import tkinter as tk
from tkinter import ttk
class AboutWindow(tk.Toplevel):
def __init__(self, main_window):
super().__init__(main_window)
self.title("About MQTT Client")
self.geometry('400x350')
self.transient(main_window)
self.grab_set()
text = tk.Text(self, font=("Helvetica", 12), height=10)
text.pack(padx=10, pady=10, expand=True, fill=tk.BOTH)
ttk.Button(self, text='OK', command=self.destroy).pack(pady=5)
basedir = os.path.dirname(__file__)
file_name = os.path.join(basedir, "README.md")
try:
with open(file_name, 'r') as f:
text.insert(tk.INSERT, f.read())
except FileNotFoundError:
text.insert(tk.INSERT, "README.md file not found.\n\nMQTT Client by Sahin Mersin\nVersion: 0v5")