00:01
This question asks us to display five circles in a window and let the user drag each one with the mouse.
00:07
So this is really a graphics and mouse event program.
00:10
First we create a canvas and draw five circles in the starting position shown in the picture.
00:15
And each circle can be made with create underscore oval.
00:21
Self .c1 equals canvas.
00:24
Dot create underscore oval parentheses x1 y1 x2 comma y2 fill equals blue the main idea is that when the mouse is pressed on a circle we need to know which circle was clicked then when the mouse moves we move that same circle so we usually bind mouse events to the canvas one of it handles the mouse press and another handles dragging canvas.
00:58
Bind parentheses quotation button one, self.
01:08
Select circle, canvas.
01:13
Bind, b1 -motion, self.
01:26
Drag circle.
01:31
In the mouse press method, we figure out which circle is closest to where the user clicked.
01:36
We save that circle as the current one.
02:03
Self...