-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuFile.py
More file actions
50 lines (42 loc) · 1.13 KB
/
Copy pathMenuFile.py
File metadata and controls
50 lines (42 loc) · 1.13 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import random
import sqlite3
import time
import sys
import getopt
import mysql.connector
from mysql.connector import Error
import pathlib
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox as msg
import Lotto
class MenuFile:
def __init__(self, menu, win):
self.win = win
self.file = tk.Menu(menu, tearoff = 0)
self.file.add_command(label="New")
self.file.add_command(label="Open")
self.file.add_command(label="Save")
self.file.add_command(label="Save As...")
self.file.add_separator()
self.file.add_command(label="Exit", command=self.quit)
menu.add_cascade(label="File", menu=self.file)
def quit(self):
print("exit")
ext = msg.askokcancel("Exit", "Realy, Exit?") # return True, False
if ext == True :
print("ok")
self.win.quit()
elif ext == False :
#tk.messagebox.showinfo("id")
print("no")
# def _quit(self):
# print("exit")
# ext = msg.askokcancel("Exit", "Realy, Exit?") # return True, False
# if ext == True :
# print("ok")
# self.win.quit()
# elif ext == False :
# #tk.messagebox.showinfo("id")
# print("no")
#