die setvalue(value quitbutton activate(pt win getmouse(close up shop win close(main(notice that near the top of the program have built the visual interface by creating the two dieviews and two buttons to demonstrate the activation feature of buttonsthe roll button is initially activebut the quit button is left deactivated the quit button is activated inside the event loop below when the roll button is clicked this approach forces the user to roll the dice at least once before quitting the heart of the program is the event loop it is just sentinel loop that gets mouse clicks and processes them until the user successfully clicks the quit button the if inside the loop ensures that the rolling of the dice only happens when the roll button is clicked clicking point that is not inside either button causes the loop to iteratebut nothing is actually done summary this has shown you how to work with class definitions here is summary of some key pointsan object comprises collection of related data and set of operations to manipulate that data data is stored in instance variables and manipulated via methods every object is an instance of some class it is the class definition that determines what the attributes of the object will be programmers can create new kinds of objects by writing suitable class definitions python class definition is collection of function definitions these functions implement the methods of the class every method definition has special first parameter called self the actual parameter of self is the object to which the method is being applied the self parameter is used to access the attributes of the object via dot notation the special method __init__ is the constructor for class its job is to initialize the instance variables of an object defining new objects (via classcan simplify the structure of program by allowing single variable to store constellation of related data objects are useful for modeling real world entities these entities may have complex behavior that is captured in method algorithms ( projectileor they may be little more than collection of relevant information about some individual ( student record