473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Numeric Entry in Tkinter

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?

Jan 23 '06 #1
0 1234

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: wang xiaoyu | last post by:
Hello,everyone. my program runs well in windows,i use tkSimpleDialog to receive some input,but when i copy my program into Linux RH8.0,entrys in my tkSimpleDialog derived Dialog have a vital...
5
by: Otto Krüse | last post by:
Hi everyone, I'm building a GUI in which I want, amongst other things, for people to fill in there postal code. The postal codes of my country (Holland) are in this format: 1234 AB So for the...
7
by: Michael Onfrek | last post by:
Hi! I'm playing with entry again and trying to restrict length of entry widget to certain number of character, so users cannot enter more character into it. Any ideas? Reg. Michael Onfrek
2
by: Ian Vincent | last post by:
I am hoping someone may be able to help. I am using Python and TKinter to create a GUI program that will eventually create an XML file for a project I am working on. Now, the XML file contents...
2
by: Martyn Quick | last post by:
If I create a Tkinter.Entry widget, I can adjust the background and the text colours, using the background and foreground options. However, if the state is "disabled", then this has no effect and...
3
by: ElBeardo | last post by:
Hello, I´m new to Python.. so this is a newbee question. I´d like to put the value enterd in the entryfield in a variable. I´m trying to build a calculator with python and TKinter, coding it in...
3
by: asit | last post by:
from Tkinter import * def callback(): print e.get() master=Tk() e=Entry(master) e.pack(anchor=CENTER)
1
by: skanemupp | last post by:
in this program when using the "c"-button it deletes the last token entered. i want to delete the token after the mousecursor. lets say the string is: 12*(81**.5+12) and i put the cursor between...
0
by: Leonhard Vogt | last post by:
Hello I have the following problem in Python 2.5 on Windows XP. On Ubuntu I do not see the problem. I have a Tkinter application as in the following example The entry-widget is somehow...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.