-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassMenu.py
29 lines (21 loc) · 1.04 KB
/
ClassMenu.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
import tkinter as tk
# ----------------------------
from ClassEvent import xevents
class MainMenu(tk.Menu):
def __init__(self, _parent):
super().__init__()
self.parent = _parent
self.mainmenu = None
self.set_default()
def set_default(self):
self.mainmenu = tk.Menu(self)
self.parent.config(menu=self.mainmenu)
filemenu = tk.Menu(self.mainmenu, tearoff=False, border=1)
filemenu.add_command(label="Открыть файл с данными")
filemenu.add_command(label="Подключиться к базе")
filemenu.add_command(label="Выход", command=lambda: xevents.call_event("Application quit"))
helpmenu = tk.Menu(self.mainmenu, tearoff=False, border=1)
helpmenu.add_command(label="Помощь")
helpmenu.add_command(label="О программе")
self.mainmenu.add_cascade(label="Файл", menu=filemenu)
self.mainmenu.add_cascade(label="Справка", menu=helpmenu)