widgets one very common use of objects is in the design of graphical user interfaces (guisback in we talked about guis being composed of visual interface objects called widgets the entry object defined in our graphics library is one example of widget now that we know how to define new classeswe can create our own custom widgets example programdice roller let' try our hand at building couple of useful widgets as an example applicationconsider program that rolls pair of standard (six-sideddice the program will display the dice graphically and provide two buttonsone for rolling the dice and one for quitting the program figure shows snapshot of the user interface figure snapshot of dice roller in action you can see that this program has two kinds of widgetsbuttons and dice we can start by developing suitable classes the two buttons will be instances of button classand the class that provides graphical view of the value of die will be dieview building buttons buttonsof courseare standard elements of virtually every gui these days modern buttons are very sophisticatedusually having -dimensional look and feel our simple graphics package does not have the machinery to produce buttons that appear to depress as they are clicked the best we