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] syntax highlighting

2011-05-23 Thread Alan Gauld
"Nemes Andrei" wrote Better yet, is there a nicer way to do syntax highlighting? Take a look at the IDLE source - it is all in Python/Tkinter and available in the standard distribution. It seems to handle syntax highlighting OK... HTH, -- Alan Gauld Author of the Learn to Program web si

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] Button

2011-05-23 Thread Alan Gauld
"psao pollard-flamand" wrote You know when you click a tkinter button and the window usually freezes until its done? Actually it doesn't *usually* freeze because most Tkinter apps are designed to prevent that :-) Does any one know how to stop that? The key here is that GUI event handl