Re: [Tkinter-discuss] Callbacks to classes

2011-05-23 Thread Bob van der Poel
> It's not useless if, as appears to be the case here, > the class in question is implementing a modal dialog. > On the contrary, I think it's actually rather elegant, > if a bit surprising! Thanks for confirming that I'm not completely out of my mind doing things this way :) Seriously, I'm sure

Re: [Tkinter-discuss] Callbacks to classes

2011-05-23 Thread Greg Ewing
Alan Gauld wrote: Using a class is very unusual and has several drawbacks. The main one is that Tkinter calls the call-back object which in the case of a class creates a new instance. So you are constantly creating new objects to which you have no reference so cannot call their methods It's no

Re: [Tkinter-discuss] Callbacks to classes

2011-05-23 Thread Alan Gauld
"Bob van der Poel" wrote > I was setting up a menu call back to a Class with code like: > > Button(bf, text=txt, height=1, command=cmd).grid(column=c, row=0, > pady=5) I got some help over in comp.python on this. Apparently there was a change between 2.6 and 2.7. There are 3 easy solutions:

Re: [Tkinter-discuss] Callbacks to classes

2011-05-21 Thread Bob van der Poel
> Anyway, I've got a number of programs which suddenly stopped working. > I think due to a change from python 2.6 to 2.7. > > I was setting up a menu call back to a Class with code like: > >    Button(bf, text=txt, height=1, command=cmd).grid(column=c, row=0, pady=5) > > when 'cmd' was a simple cla