button py from graphics import class button""" button is labeled rectangle in window it is activated or deactivated with the activate(and deactivate(methods the clicked(pmethod returns true if the button is active and is inside it ""def __init__(selfwincenterwidthheightlabel)""creates rectangular buttonegqb button(mywincenterpointwidthheight'quit'"" , width/ height/ , center getx()center gety(self xmaxself xmin +wx- self ymaxself ymin +hy- point(self xminself yminp point(self xmaxself ymaxself rect rectangle( , self rect setfill('lightgray'self rect draw(winself label text(centerlabelself label draw(winself deactivate(def clicked(selfp)"returns true if button active and is insidereturn (self active and self xmin < getx(<self xmax and self ymin < gety(<self ymaxdef getlabel(self)"returns the label string of this button return self label gettext(def activate(self)"sets this button to 'activeself label setfill('black'self rect setwidth( self active true