-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage.py
More file actions
22 lines (18 loc) · 795 Bytes
/
Copy pathHomePage.py
File metadata and controls
22 lines (18 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import tkinter
import MinesweeperGUI_TK as Game
class HomePage:
def __init__(self):
self.HomeScreen=tkinter.Tk("MS","MineSweeper")
self.HomeScreen.title="MineSweeper"
Labeling=tkinter.Label(self.HomeScreen, text="MineSweeper")
Labeling.grid()
LevelButton=[]
LevelButton.append(tkinter.Button(self.HomeScreen,text="Easy",command=lambda: self.play("e")))
LevelButton.append(tkinter.Button(self.HomeScreen, text="Medium", command=lambda: self.play("m")))
LevelButton.append(tkinter.Button(self.HomeScreen, text="Difficult", command=lambda: self.play("h")))
for i in LevelButton:
i.grid()
self.HomeScreen.mainloop()
def play(self,diff):
self.HomeScreen.destroy()
Game.Game(diff)