Hi!! Actually,i am doing a simulation and i want a dot (small oval) to pop up when i click(by mouse) on the canvas.
can anyone please help me or if possible give me the piece of codes to perform this.
thanks in advance...

The following code is incomplete, because it wont accomplish what you have asked for. But, thanks to Jrcagle, the code borrows some idea from his last post. Also some one in this forum have mentioned about getting (x, y) coordinates of where you click. I was just trying something with those ideas, and could do only this much. May be some one here might guide you further.

from Tkinter import *

root = Tk()

def callback(event):
    drawcircle(event.x, event.y)
def drawcircle(x, y):
    canvas.create_text(x,y, text="(%d,%d)"%(x,y))
    return canvas.create_rectangle(x,y,x+1,y+1,fill='blue')
canvas = Canvas(root, width=600, height=600, bg='white')
canvas.bind("<Button-1>", callback)

canvas.pack()

kath.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.