MCPcopy Create free account
hub / github.com/geekcomputers/Python / show

Function show

Droplistmenu/GamesCalender.py:5–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3from tkcalendar import Calendar
4
5def show():
6 visitor = selected1.get()
7 home = selected2.get()
8
9 # Validation: Check if teams are the same
10 if visitor == home:
11 messagebox.showwarning("Input Error", "Visitor and Home teams cannot be the same!")
12 return
13
14 game = f"{visitor} vs {home} on {cal.get_date()}"
15
16 # Update the Text widget
17 display_area.config(state=tk.NORMAL) # Enable editing
18 display_area.insert(tk.END, game + "\n")
19 display_area.config(state=tk.DISABLED) # Make read-only
20
21 # Optional: Clear dropdowns or reset
22 selected1.set("Team 1")
23 selected2.set("Team 2")
24
25window = tk.Tk()
26window.title("Game Scheduler")

Callers

nothing calls this directly

Calls 3

setMethod · 0.80
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected