Example #1
0
        def hearMotion(event):
            print("Double click")
            # Grab x and y from even
            x = event.x
            y = event.y

            # Delete circles that is already in the list
            check = False
            for shape in self.objectList:
                if (getdif(shape.getX(),x) < 10) and (getdif(shape.getY(),y) < 10):
                    canvas.delete(shape.getShapeID())
                    self.objectList.remove(shape)
                    check = True
                    ImageToSound.kill(shape.getMusicID())

            if (check == False):
                self.draw_circle(canvas,event.x,event.y)
                ImageToSound.run(imageArray,x, y, self.count, 3)
            pass
Example #2
0
        def hearMouseclick(event):
            print("1 click")
            # Grab x and y from even
            x = event.x
            y = event.y

            # Outputting x and y coords to console
            # print (x,y)

            # Delete circles that is already in the list
            check = False
            for shape in self.objectList:
                if (getdif(shape.getX(),x) < 10) and (getdif(shape.getY(),y) < 10):
                    canvas.delete(shape.getShapeID())
                    self.objectList.remove(shape)
                    check = True
                    ImageToSound.kill(shape.getMusicID())

            #draw a circle at that position
            if (check == False):
                self.draw_circle(canvas,event.x,event.y)
                ImageToSound.run(imageArray,x, y, self.count, 1)
                self.count += 1