Numeric Entry in Tkinter

D

Dustan

Earlier I asked about limitting what a user can enter in an Entry. I
got a few greatly appreciated replies, but I was hoping it would be
possible to take a more direct approach, that is, is there a method I
can override, when creating a class that inherits the Entry methods,
that is called whenever the user enters a key? I'm thinking something
like this in the override version:

def method(self, key):
if key in "1234567890":
Entry.method(self, key)
else:
pass

Is this possible? I suppose key would actually be accessed using an
associated get() method or something of the sort, but you get the idea.
Is there such a method?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,281
Messages
2,571,399
Members
48,096
Latest member
charlessmith

Latest Threads

Top