Saul Spatz writes:
> In tcl/tk an Entry widget can be set to validate its contents with
> the validate option. [...] Can one do something like this in
> tkinter?
i read the thread and nobody mentioned the python mega widget (Pmw)
toolkit, from whose docs i quote the following
Pmw.EntryField()
Peter,
> I think it doesn't matter whether you type in text, or insert it with Ctrl+V
> or the middle mouse button. The validatecommand handler is always triggered.
> I suspect achieving the same effect with Button/KeyPress handlers would
> require significantly more work.
Thank you!
Malcolm
-
pyt...@bdurham.com wrote:
> How would your examples work with text being inserted or deleted via the
> clipboard?
>
> Is there anything special that would have to happen for changes to a
> widget's value as the result of one of these events?
I think it doesn't matter whether you type in text, or
Peter,
How would your examples work with text being inserted or deleted via the
clipboard?
Is there anything special that would have to happen for changes to a
widget's value as the result of one of these events?
Thank you,
Malcolm (not the OP)
--
http://mail.python.org/mailman/listinfo/python-
On Jul 25, 2:08 pm, Peter Otten <__pete...@web.de> wrote:
> Terry Reedy wrote:
> > On 7/25/2011 8:31 AM, Peter Otten wrote:
> >> Saul Spatz wrote:
> > is it possible to set an onkey handler, that will pass on
> > valid keys?
>
> With validatecommand you can have tkinter provide the string that is b
Terry Reedy wrote:
> On 7/25/2011 8:31 AM, Peter Otten wrote:
>> Saul Spatz wrote:
>>
>>> That doesn't work, I'm being stupid, The user might type anywhere in
>>> the
>>> string, not just at the end. I need
>>>
>>> return all([c in '1234567890abcdefABCDEF ' for c in after])
>
> If one wants to
On 7/25/2011 8:31 AM, Peter Otten wrote:
Saul Spatz wrote:
That doesn't work, I'm being stupid, The user might type anywhere in the
string, not just at the end. I need
return all([c in '1234567890abcdefABCDEF ' for c in after])
If one wants to validate keystrokes, rather than the entire fi
Thanks, that a great link.
--
http://mail.python.org/mailman/listinfo/python-list
Yes, the tuple is certainly easier to read.
Thanks again.
--
http://mail.python.org/mailman/listinfo/python-list
Saul Spatz wrote:
> That doesn't work, I'm being stupid, The user might type anywhere in the
> string, not just at the end. I need
>
> return all([c in '1234567890abcdefABCDEF ' for c in after])
Ah, you found out already. Here's what I've come up with in the meantime.
I also changed the comman
That doesn't work, I'm being stupid, The user might type anywhere in the
string, not just at the end. I need
return all([c in '1234567890abcdefABCDEF ' for c in after])
--
http://mail.python.org/mailman/listinfo/python-list
Thanks so much, this is great. I want to validate that the user is entering a
string appropriate for bytes.fromhex. Here's how I modified your validate
funtion:
def validate(before, after):
print(before, "-->", after)
#return after.isdigit()
return after[-1] in '1234567890abcdefABC
Am 25.07.11 02:11, schrieb Saul Spatz:
> In tcl/tk an Entry widget can be set to validate its contents with the
> validate option. You have to give it a validatecommand (vcmd), which is a
> tcl script that runs when some action triggers validation. Usually, the
> script would use "percent subs
Saul Spatz wrote:
> In tcl/tk an Entry widget can be set to validate its contents with the
> validate option. You have to give it a validatecommand (vcmd), which is a
> tcl script that runs when some action triggers validation. Usually, the
> script would use "percent substitutions" so the scrip
I want to interface to the native validation of tk. If you don't know what
that is, you're unlikely to be able to help me.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 24, 7:11 pm, Saul Spatz wrote:
>
> Can one do something like this in tkinter?
(1) First of all what exactly do you wish return?
* an integer
* a float
* something else?
(2) Is this input part of a modal or non-modal interface?
For me, input validation should happen in *real* time an
In tcl/tk an Entry widget can be set to validate its contents with the validate
option. You have to give it a validatecommand (vcmd), which is a tcl script
that runs when some action triggers validation. Usually, the script would use
"percent substitutions" so the script would be something lik
17 matches
Mail list logo