will be set active and the others will be inactive to implement this behaviorwe can add helper method called choose to the pokerinterface class the choose method takes list of button labels as parameteractivates themand then waits for the user to click one of them the return value of the function is the label of the button that was clicked we can call the choose method whenever we need input from the user for exampleif we are waiting for the user to choose either the "roll diceor "quitbuttonwe would use sequence of code like thischoice self choose(["roll dice""quit"]if choice ="roll dice"assuming the buttons are stored in an instance variable called buttonshere is one possible implementation of choosedef choose(selfchoices)buttons self buttons activate choice buttonsdeactivate others for in buttonsif getlabel(in choicesb activate(elseb deactivate(get mouse clicks until an active button is clicked while truep self win getmouse(for in buttonsif clicked( )return getlabel(function exit here the other widgets in our interface will be our dieview that we developed in the last two basicallywe will use the same class as beforebut we need to add just bit of new functionality as discussed abovewe want to change the color of die to indicate whether it is selected for rerolling you might want to go back and review the dieview class rememberthe class constructor draws square and seven circles to represent the positions where the pips of various values will appear the setvalue method turns on the appropriate pips to display given value to refresh your memory bithere is the setvalue method as we left itdef setvalue(selfvalue)turn all the pips off for pip in self pips