Bugs/issues in tkinter.simpledialog!!

Nick Stinemates nstinemates at gmail.com
Wed Jan 26 13:42:24 EST 2011


> However some things never change it seems and some improvements are
> actually a step backwards. The same problems with the unit test in 2.x
> got ported to 3.x. And the new SimpleDialog is just more lackluster
> code like we've seen before. I was hoping to be amazed, i am
> disappointed and disgusted. It is obvious that whoever is writing/
> maintaining the tkinter code base does NOT understand tkinter
> completely and this is blinding apparent by reading the source code!


> -----------
>  Issues
> -----------
>
> First lets start with the problems that migrated from 2.x...
> (tkinter.simpledialog)
>
> #-- ISSUE 1 --#
> In the test() function we still have code that uses the "quit" method
> instead of "destroy". Calling the "quit" method only tells Tkinter to
> stop processing events, IT DOES NOT DESTROY THE WIDGET!! And on
> windows the the root will then become unresponsive -- you cannot close
> the window, you cannot do anything. I have said time and time again.
> DO NOT USE THE QUIT METHOD UNLESS YOU KNOW WHAT THE HECK YOU ARE
> DOING! So the code needs to be this...
>
> OLD:
>   q = Button(root, text='Quit', command=t.quit)
>
> NEW:
>   q = Button(root, text='Quit', command=root.destroy)
>
>
> #-- ISSUE 2: --#
> The author used a very strange method by which to denote the default
> button in the SimpleDialog class. He choose to set the relief to RIDGE
> and the border "8". This not only looks horrible (and exposes the
> authors ignorance of tkinter) but a much more elegant solution is
> provided by the TclTk folks. All buttons have a "default" option that
> will display the button with a nice border so the user can visually
> see which button is active. So the code should be this....
>
> OLD:
>            if num == default:
>                b.config(relief=RIDGE, borderwidth=8)
>
> NEW:
>            if num == default:
>                b.config(default=ACTIVE)
>
>
> Last but not least i am puzzled as to why we choose the method name
> "go" over "show". for "showing" the dialog.  SimpleDialog uses no
> inheritance so name clashes are mum. Why would anyone choose "go" over
> "show" for a modal dialog? I would really like an explanation for
> this.
>
>
Sounds like you need to help by:

Creating a bug report
Attaching a patch

Thanks for the help, Rick.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110126/b010d4e6/attachment-0001.html>


More information about the Python-list mailing list