[issue12723] tkSimpleDialog.askstring shouldn't allow empty string input

2011-08-10 Thread Matthew Hemke

New submission from Matthew Hemke :

tkSimpleDialog.askstring allows empty input. The attached patch adds validation 
to the input to ensure it is not empty.

--
components: Tkinter
files: askstring.patch
keywords: patch
messages: 141868
nosy: rabbidous
priority: normal
severity: normal
status: open
title: tkSimpleDialog.askstring shouldn't allow empty string input
type: feature request
Added file: http://bugs.python.org/file22875/askstring.patch

___
Python tracker 
<http://bugs.python.org/issue12723>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12723] tkSimpleDialog.askstring shouldn't allow empty string input

2011-08-10 Thread Matthew Hemke

Changes by Matthew Hemke :


--
versions: +Python 2.7

___
Python tracker 
<http://bugs.python.org/issue12723>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12723] tkSimpleDialog.askstring shouldn't allow empty string input

2011-08-11 Thread Matthew Hemke

Matthew Hemke  added the comment:

What about adding a validatecommand option like on Tkinter.Entry?

For what I am trying to do it was sort of a kludge to validate the entry 
because an empty string was invalid, but in the interface design, it would have 
been "rude" to validate after the dialog closes and then keep popping up 
another tkSimpleDialog.askstring until the input is correct. It almost makes 
askstring useless because I can't validate on close.

That wouldn't break backwards compatibility would it?

--

___
Python tracker 
<http://bugs.python.org/issue12723>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12723] Provide an API in tkSimpleDialog for defining custom validation functions

2011-08-12 Thread Matthew Hemke

Matthew Hemke  added the comment:

I'm not sure if I misunderstood you, or you misunderstood me, but adding an 
option to the askstring dialog that would take a function handle would also 
allow you to use it for things other than strings (ints,etc.)

Tkinter Entry does this: you set the validatecommand option to a function 
handle that returns true or false to determine whether the input was valid.

I will try and code an example over the weekend.

--

___
Python tracker 
<http://bugs.python.org/issue12723>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com