-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathredroom.py
More file actions
31 lines (23 loc) · 693 Bytes
/
redroom.py
File metadata and controls
31 lines (23 loc) · 693 Bytes
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
import tkinter as tk
from server import Server
import subprocess
def createRoom():
serverid = int(serverid_entry.get())
root.destroy()
room = Server(host="localhost",port=serverid)
room.startServer()
def joinRoom():
root.destroy()
subprocess.call(f"start /wait pythonw client.py", shell=True)
root = tk.Tk()
root.title("create room")
root.geometry("1200x700")
serverid_label = tk.Label(root, text="Server id")
serverid_label.pack()
serverid_entry = tk.Entry(root)
serverid_entry.pack()
submit_button = tk.Button(root, text="Create", command=createRoom)
submit_button.pack()
join_button = tk.Button(root, text="Join", command=joinRoom)
join_button.pack(padx=30)
root.mainloop()