I also dislike lambdas for this purpose. I'd recommend that the original
poster build a class - many ways they could go with this, but here is one
rough sketch (haven't checked for syntax errors, etc.):
class PageButton(Button):
def __init__(self, master, text=None, page_number=0):
On Thu, Jan 29, 2009 at 2:15 PM, wrote:
> With lambda, you need to set the value of the variable at the time the
> lambda is created, or else the variable is grabbed from the environment at
> the time the lambda runs. You can do this by using the variable as a
> default argument. In your case,
With lambda, you need to set the value of the variable at the time the
lambda is created, or else the variable is grabbed from the environment at
the time the lambda runs. You can do this by using the variable as a
default argument. In your case, change:
XT.append(Button(T,text="Viola:New
Ta
On Thu, Jan 29, 2009 at 2:24 PM, Allen Taylor
wrote:
> Hello Guilherme,
>> >>> Guilherme Polo 2009-01-28 18:18 >>>
>> On Wed, Jan 28, 2009 at 7:54 PM, Allen Taylor
>> wrote:
>> > I'm trying to generate some events in Tkinter but it doesn't seem to be
>> > working the way I expected. Here's an ex
Hello Guilherme,
> >>> Guilherme Polo 2009-01-28 18:18 >>>
> On Wed, Jan 28, 2009 at 7:54 PM, Allen Taylor
> wrote:
> > I'm trying to generate some events in Tkinter but it doesn't seem to be
> > working the way I expected. Here's an example of what I'm trying to do...
> >
> > def click():
> >