Bugs/issues in tkinter.simpledialog!!

R

rantingrick

I just installed Python 3,0 on my machine. I cannot use 3.0
exclusively yet however i was interested in just poking around and
acquiring a taste if you will. I was happy to find that the new
Tkinter module names now follow convention and are placed correctly...
example: "tkinter.simpledialog"

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.


Other minor issues exists. I may describe them later. At this time we
need to fix these grave abominations first.
 
E

Emile van Sebille

On 1/26/2011 8:00 AM rantingrick said...
I just installed Python 3,0 on my machine.

Try it again on the current release candidate --
http://www.python.org/download/releases/3.2/ -- testing old first
release code and reporting on its problems won't get any traction.
Verify the problem continues to exist in the current maintained version
and then ask. If you get confirmation that the behavior is likely a
bug, file a bug report so those who can and do can do (or at least
consider).

See http://docs.python.org/bugs.html
http://www.python.org/dev/peps/pep-0003/

Emile
 
R

rantingrick

On 1/26/2011 8:00 AM rantingrick said...

Try it again on the current release candidate --http://www.python.org/download/releases/3.2/-- testing old first

Seehttp://docs.python.org/bugs.htmlhttp://www.python.org/dev/peps/pep-0003/

Why would i want to waste bandwidth downloading an RC? Can i not just
browse the source online? I only need to check one module. Where is
the source available for viewing "simpledialog" online?

Thanks

PS: The version i have now is 3.1.1 (but i would like to see the
newest version available, just not download it!)
 
B

Benjamin Kaplan

Why would i want to waste bandwidth downloading an RC? Can i not just
browse the source online? I only need to check one module. Where is
the source available for viewing "simpledialog" online?

Thanks

PS: The version i have now is 3.1.1 (but i would like to see the
newest version available, just not download it!)

The code is hosted on http://svn.python.org

If you just one that one file, it's at
http://svn.python.org/view/python/trunk/Lib/lib-tk/tkSimpleDialog.py?view=markup
 
R

rantingrick

[...snip...]

Well i should have looked before i leaped :)

This looks like an old 2.x version. I am looking for the newest
version with is renamed to "simpledialog" and contains a new class
called "SimpleDialog". Do you know were i can view this module?

Thanks again.
 
T

Terry Reedy

On 1/26/2011 11:53 AM, rantingrick wrote:

To answer your other post, one of the main people to touch tkinter in
the last 3 years was Guilherme Polo, who worked on it during and after a
Google Summer of Code project. He does not seen to be active currently.

There are currently 63 open issues on the tracker listing tkinter as a
component. There are probably a few that could be closed. When I have
learned more, I should be able to review any patched sitting around.

Why would i want to waste bandwidth downloading an RC? Can i not just
browse the source online? I only need to check one module. Where is
the source available for viewing "simpledialog" online?

Thanks

PS: The version i have now is 3.1.1 (but i would like to see the
newest version available, just not download it!)

I was hoping you meant 3.1.something, not 3.0. Latest is 3.1.3.

3.2c2 will be out very soon, and 3.2 2 weeks after if no problems arise.
As far as the doc and stdlib go, 3.2 is probably one of the most
improved releases ever, as they got almost all the attention with no
syntax changes allowed. When it is out, I will strongly recommend
upgrading, absent a really good reason not to.
>(but i would like to see the
> newest version available, just not download it!)

http://svn.python.org/view/python/b...er/simpledialog.py?revision=81010&view=markup

go back up a step and you can look at the log of changes.
For current python 3 in general:

http://svn.python.org/view/python/branches/py3k/

If you install TortoiseSVN, it is trivial to download the whole source
tree. I believe you could also just download a subtree, like the tkinter
and/or idlelib subtrees.

Sometime after 3.2 is out, we will move from svn to hg and above will
change.
 
R

rantingrick

On 1/26/2011 11:53 AM, rantingrick wrote:

To answer your other post, one of the main people to touch tkinter in
the last 3 years was Guilherme Polo, who worked on it during and after a
Google Summer of Code project. He does not seen to be active currently.

There are currently 63 open issues on the tracker listing tkinter as a
component. There are probably a few that could be closed. When I have
learned more, I should be able to review any patched sitting around.

Well i tried searching for "Tkinter" issues on the tracker and just
got annoyed quickly and left. It seems far to complicated to do
searches with this software.


Anyhoo, i did find the most current version of tksimpledialog.py and
sure enough all the issues i have documented have been ported into
this new version.
 
G

Giampaolo Rodolà

2011/1/26 rantingrick said:
I just installed Python 3,0 on my machine. I cannot use 3.0
exclusively yet however i was interested in just poking around and
acquiring a taste if you will. I was happy to find that the new
Tkinter module names now follow convention and are placed correctly...
example: "tkinter.simpledialog"

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.


Other minor issues exists. I may describe them later. At this time we
need to fix these grave abominations first.

Why don't you file a ticket on the bug tracker instead of wasting
yours and other people's time here by making appear another rant
against Tkinter as a bug report?
It's been 3 days in a row you've been doing this. Aren't you tired?
Seriously! This has come to not even being a rant anymore. It's just nonsense.


--- Giampaolo
http://code.google.com/p/pyftpdlib/
http://code.google.com/p/psutil/
 
R

rantingrick

Why don't you file a ticket on the bug tracker instead of wasting
yours and other people's time here by making appear another rant
against Tkinter as a bug report?

Why don't you instead thank me for helping out instead of jumping to
irate conclusions? It would *seem* that if YOU cared about the future
of Python you would be more *accepting* of my help.
[...snip: shameless plugs...]

Oh, i see why you dropped by; First to score some points on my behalf
and then to plug your own software. Interesting.
 
B

Benjamin Kaplan

Why don't you instead thank me for helping out instead of jumping to
irate conclusions? It would *seem* that if YOU cared about the future
of Python you would be more *accepting* of my help.

It's not that people don't appreciate your help. It's that the mailing
list is not the appropriate place for this type of discussion. Once
it's been verified as a bug, you should create a ticket on the bug
tracker, come back here and post a link, and then move the discussion
over to the tracker. Even if you intend to fix it yourself, you should
create a ticket and then attach the patch to the ticket when you fix
it.
 
R

rantingrick

It's not that people don't appreciate your help.

First: Thanks for the reasonable response.
It's that the mailing
list is not the appropriate place for this type of discussion.

Actually i see you point but there is a good reason behind me bringing
this up here. I want to bring to the attention of everyone how little
interest there is for Tkinter. Not many folks are using Tkinter, most
hate Tkinter, and not many (if any) are capable of patching the
Tkinter source code. It has been mentioned in this thread that the
last person to do any real work on Tkinter is someone from two years
ago. This is insanity! You know why i think nobody cares..

* Too much trouble to get patches submitted.
* Nobody really cares at py-dev so the patches never get resolved.
* There is resistance in the community to "outsiders".

This mentality is setting us up for a bad bad future. Why are people
so pedantic and emotional. Python does not belong to me, or you, or
anybody. This is a team effort. And whist we need people doing work we
also need to listen to the community. I have had nothing but an uphill
battle dealing with a few "elites" on this list. Anybody can see that
i am serious about helping out. Heck, i want Tkinter to be removed
from the stdlib but yet i still offer help to noobies and still report
bugs.
Once
it's been verified as a bug, you should create a ticket on the bug
tracker, come back here and post a link, and then move the discussion
over to the tracker.

Agreed. However i would rather just write a patch, send it to some
email and be done. Or just commit the changes myself. This bug
tracker is just bureaucracy at it's worst. You are making this process
too hard and people are not going to get involved when they have to
jump through 20 hoops just to patch three lines of freaking code!
There is too much red tape here. I COULD HAVE PATCHED HUNDREDS OF LINE
OF CODE IN THE TIME I HAVE WASTED WITH THE BUG TRACKER PROCESS ALONE!
I understand we need checks and balances but at some point the very
safety net we rely on becomes a noose around our neck! Something
needs to be done!
 
A

alex23

rantingrick said:
Actually i see you point but there is a good reason behind me bringing
this up here. I want to bring to the attention of everyone how little
interest there is for Tkinter.

Right. You have no interest in resolving this issue and instead want
to use it as more ammunition in your ongoing crusade. You even have
the gall to act _offended_ at Giampaolo's suggestion that you log the
bug, dumping your usual bullshit and vitriol on someone WHO HAS
ACTUALLY DONE THE SORT OF WORK YOU CONSTANTLY CLAIM YOU'RE GOING TO,
even though your every intention was to parade this issue around as if
it somehow validates your personal blend of crazy.

You're a class act, that's for sure.
Agreed. However i would rather just write a patch, send it to some
email and be done. Or just commit the changes myself. This bug
tracker is just bureaucracy at it's worst. You are making this process
too hard and people are not going to get involved when they have to
jump through 20 hoops just to patch three lines of freaking code!

Because complex distributed coding projects should be treated like
Wikipedia?

It must suck being such a genius and yet be unable to grapple with a
simple bug tracker...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top