コード例 #1
0
    def __init__(self, master):
        tk.LabelFrame.__init__(self, master)

        self.sorry_frame = tk.Frame(self)
        self.sorry_frame.pack(fill="both", expand=True)

        if not An.is_any_question():
            self.sorry_lbl = tk.Label(
                self.sorry_frame,
                text=
                "Üzgünüm, bu özellikte bir hayvan bulamadım ve başka sorum kalmadı.\n\nŞimdi napalım ?"
            )
            self.sorry_lbl.pack(pady=100)

        else:
            self.sorry_lbl = tk.Label(
                self.sorry_frame,
                text=
                "Üzgünüm, bu özellikte bir hayvan bulamadım.\n\nBaşka soruya geçelim bakalıımm..."
            )
            self.sorry_lbl.pack(pady=100)

        self.pass_btn_frame = tk.Frame(self)
        self.pass_btn_frame.pack(fill="y", expand=True)

        if not An.is_any_question():
            self.guess_btn = tk.Button(
                self.pass_btn_frame,
                text="Tahmin et",
                padx=10,
                pady=10,
                command=lambda: master.switch_frame(AnimalGuessPage))
            self.restart_btn = tk.Button(self.pass_btn_frame,
                                         text="Yeniden Oynayalım",
                                         padx=10,
                                         pady=10,
                                         command=lambda: master.restart())
            self.exit_btn = tk.Button(
                self.pass_btn_frame,
                text="Çık",
                padx=10,
                pady=10,
                command=lambda: master.switch_frame(ExitPage))
            self.guess_btn.pack(side=tk.LEFT, padx=10)
            self.restart_btn.pack(side=tk.LEFT, padx=10)
            self.exit_btn.pack(side=tk.LEFT, padx=10)
            self.guess_btn.focus()
        else:
            self.pass_btn = tk.Button(
                self.pass_btn_frame,
                text="Yeni soruya geç",
                padx=10,
                pady=10,
                command=lambda: master.switch_frame(QuestionPage))
            self.pass_btn.pack()
            self.pass_btn.focus()
コード例 #2
0
 def is_any_animal(self):
     if not An.is_any_animal():
         self.switch_frame(AnimalGuessPage)
     elif not An.is_any_question():
         self.switch_frame(NoQuestionGuessPage)
     else:
         self.switch_frame(QuestionPage)