[Tkinter-discuss] =?x-gbk?Q?=BB=D8=B8=B4=A3=BA__get__?= =?x-gbk?Q?root=2Ewinfo=5Fpointerxy=28=29?=

John McMonagle jmcmonagle at velseis.com
Fri Sep 2 04:32:20 CEST 2011


On 02/09/11 12:18, ÊØÖê´ýÍÃ wrote:
> 
> in my program,myprint is:
> 
> def  myprint(arg):
>     x=arg.x
>     y=arg.y
>     canvas.create_text(x,y,text='i am here')
>     


Take advantage of Tk canvas tags.

def myprint(arg):
    x = arg.x
    y = arg.y
    canvas.delete('text')   # delete any canvas items with the tag name text
    canvas.create_text(x, y, text='i am here', tags='text')

Regards,

John

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the Tkinter-discuss mailing list