summaryrefslogtreecommitdiff
path: root/pypers/bolzano/gui/canvas.py
blob: ffb89f31eca0da376e62bdd3d6266428b41e852d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from Tkinter import *

def on_click(event):
    print event
    print event.x, event.y
    
root = Tk()

c = Canvas()

c.config(background="red", selectforeground="green")
c.create_rectangle(0, 0, 100, 100)
c.create_line(0, 0, 10, 100, 200, 300)

c.bind("<Button-1>", on_click)
c.pack()

mainloop()