It is expected behavior. The built-in key and mouse bindings are bound to the 
class, so if you change the class of a widget it will no longer have these 
bindings.

Changing the class is mostly useful if you want to create a completely 
different set of bindings for a widget. 

--bryan


On Mar 31, 2013, at 1:58 AM, Alejandro Autalan <alejandroauta...@gmail.com> 
wrote:

> Hello all.
> 
> I'm reading the tkinter reference at 
> http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html.
> 
> It says that the 'class_' attribute is available for ttk widgets.  But when 
> is set, some widgets become  unresponsive.
> 
> Example:
> 
> #uname -a   Linux vostro1 3.2.0-4-amd64 #1 SMP Debian 3.2.39-2 x86_64 
> GNU/Linux
> # Python 3.2.3
> #tkinter.TkVersion 8.5
> 
> import tkinter as tk
> from tkinter import ttk
> 
> f = ttk.Frame()
> f.grid()
> entry = ttk.Entry(f, class_='CustomEntry')
> entry.grid()
> btn = ttk.Button(f, class_='CustomButton', text='Button')
> btn.grid()
> f.mainloop()
> 
> When I run the example, I can't enter text on entry widget or click a button.
> Is this the expected behaviour? Anyone know how this attribute should be used 
> for ttk widgets ?
> 
> Thanks.
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to