0

I have generated a circle with graphic.py. I want the color of the circle to change with a mouse click. How can I create a mouse event for this?

def draw_circle():
#make green circle 
    win = GraphWin('Traffic Lights', 400,400)
    win.setBackground(color_rgb(211,211,211))
    pt = Point(200,200)
    cir = Circle(pt,50)
    cir.setFill('Green')
    cir.draw(win)
    win.getMouse
initial()

def click:
    #action to take place
    # when mouse cicked

add_mouse_click_handler(click)
    main()
Kay
  • 17
  • 2
  • Does this answer your question? [How to detect if mouse was clicked?](https://stackoverflow.com/questions/41688871/how-to-detect-if-mouse-was-clicked) – Robert Bradley Nov 04 '22 at 16:26

0 Answers0