viewerasfen.blogg.se

Winfo grafik
Winfo grafik







winfo grafik

] , ]Ĭheckbutton(self.root,text='3',command=lambda :self.processCardChoice(2)),Ĭheckbutton(self.root,text='4',command=lambda :self.processCardChoice(3))], #See the comment above setup Novice _Field.īutton(self.root,command=lambda :self.processCardChoice(2)),īutton(self.root,command=lambda :self.processCardChoice(3))],

winfo grafik

Self.checkButtonField = , Self.buttonField = , Self._destroyAllButtons() if self.buttonField else None #feature correctly via list comprehension. #Hard Coded lists of button widgets because python won't let me generate each of the Button's command Showinfo("Not a set","Not a set because 2 are %s and 1 is %s" % (result,result)) Showinfo("Repeat","You've already made this set")Įlif type(result) = tuple: #Case #3: 3 choices were made but they didn't form a set. Showinfo("WINNER!","Congratulations! You found all sets!")Įlif result = 1: #Case 2: 3 choices were made but the user has made this set before in the game. Pic = PhotoImage(file='./media/%d.gif'%h) (text="There are %d set(s) remaining on the board." % ())įor h in map(Card.getCardImgNumber, for i in ]): If result = 2: #Case 1: 3 choices were made and the Game object verified them as a set. # to get a callback on the result of adding the card choice.Ĭbutton = self.checkButtonField

winfo grafik

The function calls the game instance's addCardChoice method # Process the card location that the user picked. Hintbutton = Button(text="Hint, please!",font=("Helvetica",12),command=lambda :self.getHint()) Timer = Label(self.root,text="Untimed Mode",bg="green",relief=Tkinter.RAISED,font=('Helvetica',12)) Self.remainderLabel = Label(self.root,text="There are %d set(s) remaining on the board." % (),bg="white",relief=Tkinter.RAISED,font=('Helvetica',12)) ('a',lambda e:gamedifficulty.invoke(Difficulty.ADVANCED)) ('n',lambda e:gamedifficulty.invoke(Difficulty.NOVICE)) ('b',lambda e:gamedifficulty.invoke(Difficulty.BEGINNER)) If GUIHandler.screenwidth ',lambda e:gamemenu.invoke(0)) GUIHandler.screenheight = _screenheight() # Initializes the GUI setup of the program.









Winfo grafik