Re: [Tkinter-discuss] Problems with lambda functions in callbacks

2007-02-15 Thread Bob Greschke
On Feb 15, 2007, at 08:47, Dídac Busquets wrote: > Hello, > > I'm trying to create a set of buttons to which I assign a callback > that > is the same for all of them, except for the parameter (to do this I > use > a lambda function). I want to get the buttons numbered from 0 to 4, so > that w

Re: [Tkinter-discuss] Problems with lambda functions in callbacks

2007-02-15 Thread Stewart Midwinter
Dídac, aquest és un problem molt interessant. Your code doesn't work because you didn't pass in a reference to i in your lambda. The correct code appears below. BTW, if you set up your application with classes and methods, you will need to pass in a reference to self in the same way: self=self.

[Tkinter-discuss] Problems with lambda functions in callbacks

2007-02-15 Thread Dídac Busquets
Hello, I'm trying to create a set of buttons to which I assign a callback that is the same for all of them, except for the parameter (to do this I use a lambda function). I want to get the buttons numbered from 0 to 4, so that when I click on any of them, it prints out its number (that is, but

[Tkinter-discuss] calling B1-Motion and Leave events symontaneously?

2007-02-15 Thread mina dehghan
Hi, I am trying to implement lasso selection technique to select a set of rectangles on a canvas. When the usr leaves a rectangle while B1 is down the current rectangle is either selected or reselected. So I need to use two events: bound to the canvas and bound to rectangles. But only B1-m