This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年06月08日 21:28 by busfault, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| tkSimpleDialog.py | busfault, 2011年06月08日 21:28 | tkSimpleDialog | ||
| issue12288.diff | asvetlov, 2012年07月29日 12:27 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg137925 - (view) | Author: Tom Middleton (busfault) | Date: 2011年06月08日 21:28 | |
Using Tkinter under Python 2.7.1 (Windows XP FWIF) If using the tkSimpleDialog.askinteger() function with an initialvalue = 0, the 0 is not displayed in the dialog box. The same is true for tkSimpleDialog.askfloat(). The cause of this seems to be the following: in Lib\libi-tk\tkSimpleDialog.py (attached for convenience) under class _QueryDialog(Dialog) def body(self, master): w = Label(master, text=self.prompt, justify=LEFT) w.grid(row=0, padx=5, sticky=W) self.entry = Entry(master, name="entry") self.entry.grid(row=1, padx=5, sticky=W+E) if self.initialvalue: self.entry.insert(0, self.initialvalue) self.entry.select_range(0, END) return self.entry The if self.initialvalue will evaluate to a FALSE when the initial value is a 0. Changing this line to: if self.initialvalue is not None: fixed this issue. I am not certain that this is as intended or a bug. |
|||
| msg166751 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年07月29日 12:27 | |
Add patch for py3k |
|||
| msg166912 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年07月30日 17:05 | |
New changeset fd5166fdb978 by Andrew Svetlov in branch '3.2': Issue #12288: Consider '0' and '0.0' as valid initialvalue for tkinter SimpleDialog. http://hg.python.org/cpython/rev/fd5166fdb978 New changeset 2f3ccf4ec193 by Andrew Svetlov in branch 'default': Issue #12288: Consider '0' and '0.0' as valid initialvalue for tkinter SimpleDialog. http://hg.python.org/cpython/rev/2f3ccf4ec193 New changeset f98e2944cb40 by Andrew Svetlov in branch '2.7': Issue #12288: Consider '0' and '0.0' as valid initialvalue for tkinter SimpleDialog. http://hg.python.org/cpython/rev/f98e2944cb40 |
|||
| msg166914 - (view) | Author: Andrew Svetlov (asvetlov) * (Python committer) | Date: 2012年07月30日 17:12 | |
Fixed. Thank you, Tom. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:18 | admin | set | github: 56497 |
| 2012年07月30日 17:12:45 | asvetlov | set | status: open -> closed resolution: fixed messages: + msg166914 stage: resolved |
| 2012年07月30日 17:05:20 | python-dev | set | nosy:
+ python-dev messages: + msg166912 |
| 2012年07月29日 12:28:29 | asvetlov | set | title: Python 2.7.1 tkSimpleDialog initialvalue -> tkinter SimpleDialog initialvalue |
| 2012年07月29日 12:27:53 | asvetlov | set | files:
+ issue12288.diff assignee: asvetlov versions: + Python 3.2, Python 3.3 keywords: + patch nosy: + asvetlov messages: + msg166751 |
| 2011年06月08日 21:28:03 | busfault | create | |