Benny Rodríguez
Benny Rodríguez

Reputation: 47

Binding ttk Entry widget

I am trying to make a bind_class to a ttk Entry widget but it does not work. It only work properly when I bind each Entry widget separately. Would you help me?

Thank you in advance

from tkinter import ttk
from tkinter.ttk import*
from tkinter import *

root = Tk()

def clicker(event):
    myLabel = ttk.Label( root, text = 'You clicked a button' )
    myLabel.pack()

myEntry = ttk.Entry( root )
myEntry.pack()

root.bind_class( 'Entry', '<Button-1>', clicker )

root.mainloop()

Upvotes: 1

Views: 336

Answers (1)

Benny Rodr&#237;guez
Benny Rodr&#237;guez

Reputation: 47

When I replaced 'Entry' by 'TEntry' it worked perfectly

Upvotes: 2

Related Questions