April 2018
Beginner
340 pages
7h 54m
English
Let's look at the new GameWindow class and how it manages our application's main window and widgets. A lot of this code will feel familiar from our previous GameScreen class:
class GameWindow(tk.Tk): def __init__(self): super().__init__() self.title("Blackjack") self.geometry("800x640") self.resizable(False, False) self.bottom_frame = tk.Frame(self, width=800, height=140, bg="red") self.bottom_frame.pack_propagate(0) self.hit_button = tk.Button(self.bottom_frame, text="Hit", width=25, command=self.hit) self.stick_button = tk.Button(self.bottom_frame, text="Stick", width=25, command=self.stick) self.next_round_button = tk.Button(self.bottom_frame, text="Next Round", width=25, command=self.next_round) self ...