-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstart_screen.py
More file actions
41 lines (28 loc) · 1.19 KB
/
Copy pathstart_screen.py
File metadata and controls
41 lines (28 loc) · 1.19 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
import tkinter as tk
class StartScreen:
window = tk.Tk()
window.geometry("400x300")
window.wm_attributes("-topmost", 1)
window.resizable(False, False)
window.title("Start Game Screen")
def __init__(self):
self.lbl = tk.Label(master=self.window, text="Start Game")
self.start_btn_zero = tk.Button(master=self.window, text="Start Game With Zero")
self.start_btn_no_zero = tk.Button(master=self.window, text="Start Game Without Zero")
self.number_of_digits = tk.Listbox(master=self.window)
self.number_of_computers = tk.Spinbox(master=self.window, from_=2, to=4, width=5)
def create_start(self):
self.lbl.pack()
self.add_lines()
self.number_of_digits.pack()
tk.Label(master=self.window, text="How many computers will play?").pack()
self.number_of_computers.pack()
self.number_of_digits.select_set(0)
self.start_btn_zero.pack()
self.start_btn_no_zero.pack()
self.window.mainloop()
def add_lines(self):
for i in range(4, 7):
self.number_of_digits.insert(i, f"Number of digits:{i}")
def destroy_window(self):
self.window.withdraw()