Re: [Tutor] tkinter canvas

2009-01-15 Thread Mr Gerard Kelly
wow, that's excellent, thanks so much. I haven't got a clue how lambda functions work, but they seem pretty useful, so I'll try to figure them out. - Original Message - From: Kent Johnson Date: Thursday, January 15, 2009 10:24 pm Subject: Re: [Tutor] tkinter canvas &

Re: [Tutor] tkinter canvas

2009-01-15 Thread Alan Gauld
"Kent Johnson" wrote for i in range(numboxes): box[i]=w.create_rectangle((1+i)*40, 40, (2+i)*40, height-40, fill="blue") w.tag_bind(box[i], '', lambda e, i=i: enter(e, i)) w.tag_bind(box[i], '', lambda e, i=i: leave(e, i)) I'm wrong again. I've never noticed tag_bind() before. Alth

Re: [Tutor] tkinter canvas

2009-01-15 Thread Kent Johnson
On Thu, Jan 15, 2009 at 12:41 AM, Mr Gerard Kelly wrote: > I want to be able to bind these boxes to an event - so that I can either > click on them, or hold the mouse cursor over them, and have them change > color. Here is a version of your program that binds the Enter and Leave events to each b

Re: [Tutor] tkinter canvas

2009-01-15 Thread Alan Gauld
"Mr Gerard Kelly" wrote All it does take a number (6 in this case) and draw that number of blue boxes on a canvas. I want to be able to bind these boxes to an event - so that I can either click on them, or hold the mouse cursor over them, and have them change color. I don;t think you can

[Tutor] tkinter canvas

2009-01-14 Thread Mr Gerard Kelly
I am trying to make a simple Tkinter program using the canvas widget. All it does take a number (6 in this case) and draw that number of blue boxes on a canvas. from Tkinter import * master = Tk() numboxes=6 width=40*(numboxes+2) height=200 w = Canvas(master, width=width, height=height) w.pack(

[Tutor] Tkinter Canvas Saving and Opening

2007-12-04 Thread Johnston Jiaa
I know that Tkinter's canvas can output its contents into a postscript file, but can that file be used in turn to restore the image? How can I implement this file-saving and opening feature? ___ Tutor maillist - Tutor@python.org http://mail.python.

Re: [Tutor] Tkinter Canvas Widget

2007-11-13 Thread Alan Gauld
"Johnston Jiaa" <[EMAIL PROTECTED]> wrote > methods.html>, but do not see how to get the coordinates of the > mouse > on the canvas. Any mouse event will give you the coordinates within the event data. Trapping the mouse Movment will ensure you track the current position, > Also, after I get t

Re: [Tutor] Tkinter Canvas Widget

2007-11-12 Thread John Fouhy
On 13/11/2007, Johnston Jiaa <[EMAIL PROTECTED]> wrote: > I'm trying to create a free-hand drawing area on my program using the > Tkinter canvas widget. I have read through all the methods on Canvas > objects methods.html>, but do not see ho

[Tutor] Tkinter Canvas Widget

2007-11-12 Thread Johnston Jiaa
I'm trying to create a free-hand drawing area on my program using the Tkinter canvas widget. I have read through all the methods on Canvas objects , but do not see how to get the coordinates of the mouse on the canvas. Als

Re: [Tutor] Tkinter Canvas

2006-12-08 Thread Luke Paireepinart
Asrarahmed Kadri wrote: > > > Hi Folks, > > I have a Tkinter canvas and a yscrollbar attached to it. It is working > fine but what I want is that when the mouse is in the canvas region, > the scroll button of the mouse should be able to control the upward > and downward movement, How to achieve

[Tutor] Tkinter Canvas

2006-12-08 Thread Asrarahmed Kadri
Hi Folks, I have a Tkinter canvas and a yscrollbar attached to it. It is working fine but what I want is that when the mouse is in the canvas region, the scroll button of the mouse should be able to control the upward and downward movement, How to achieve this? Regards, Asrarahmed Kadri -- To