Title: Ugly buttons in some Tkinter objects in Windows
Type: Stage: resolved
Components: Tkinter, Windows Versions: Python 3.1, Python 3.2, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, gpolo, rafe.kettler
Priority: normal Keywords:

Created on 2010-10-22 02:34 by rafe.kettler, last changed 2010-11-03 18:27 by eric.araujo. This issue is now closed.

File name Uploaded Description Edit
uglybuttons.png rafe.kettler, 2010-10-22 02:34
Messages (9)
msg119359 - (view) Author: Rafe Kettler (rafe.kettler) Date: 2010-10-22 02:34
Some of the dialogs in Tkinter don't correctly show buttons in newer versions of Windows (XP, Vista, 7). Instead, they use square Win2000-and-before-type buttons. Here's some Python 2.7 code that illustrates this:

import tkMessageBox

import tkColorChooser

I attached a screenshot as well, illustrating what is meant by "ugly buttons."

I'm not sure if this is on the Tk or Tkinter side, but since the rest of Tkinter uses new-style buttons, these few objects should too (as far as I'm aware, these are the only objects that exhibit this behavior.
msg119522 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-24 17:50
In my GTK desktop environment, your two examples produce windows that don’t respect my theme.  Can you give me an example that uses correct buttons for you so that I can see what I should expect?

I’m not sure this is a bug or a feature request.
msg119523 - (view) Author: Rafe Kettler (rafe.kettler) Date: 2010-10-24 18:23
If you were to create a FileDialog, you should see proper buttons (at least I do in Windows):

import tkFileDialog

I think that this goes more along the lines of a bug, because I know that Tkinter has the ability to properly show buttons. So, it would seem to be a bug that for two types of dialogs, the buttons aren't displayed correctly and rather reflect an old-style button.

I'm not sure if this is on the Python or Tcl side of the problem, but I really have no way of testing the Tcl/Tk implementation of these dialogs.
msg119525 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-24 19:14
Thanks, I tested the file dialog example and it does not respect my theme either.  Re-adding the Windows component.

I suspect the bug is in Python.  Like you said, Tcl/Tk and Tkinter do have the ability to use new shiny buttons, it’s just two modules that are not consistent with the rest.  If you could look into the Python code and make suggestions or maybe a patch, it would help gpolo fix this.
msg119530 - (view) Author: Rafe Kettler (rafe.kettler) Date: 2010-10-24 20:53
I haven't had a chance to look too deeply into the source, but it appears (at least in Python 2.7) that the problem has something to do with the commands that the classes in tkMessageBox and tkColorChooser pass to

The Message class in tkMessageBox, the Chooser class in tkColorChooser, and the various dialog classes in tkFileDialog all subclass Dialog, which is defined in tkCommonDialog.

Since the dialogs in tkFileDialog have the right buttons, there's probably nothing wrong with the Dialog superclass. However, Chooser and Message both define their own command variables (tk_chooseColor and tk_messageBox, respectively) that are then passed to a Frame's method.

So, when I get an extra minute I'll go in and see what might be going on with tk_chooseColor and tk_messageBox.
msg120246 - (view) Author: Rafe Kettler (rafe.kettler) Date: 2010-11-02 19:21
I've tested how these dialogs display in regular Tcl/Tk, and it appears the problem resides in the Tcl implementation, not the Python binding. You can see for yourself by running this Tcl script:

package require Tk

Since this is not a Tkinter or Python issue, I think the issue should be closed and a bug (if it doesn't exist already) should be filed with the Tcl/Tk developers.
msg120291 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-02 23:49
Thanks for hunting that down.  Agreed about closing.

I have no inkling about the Tcl development process.  Can you report the bug to them?
msg120292 - (view) Author: Rafe Kettler (rafe.kettler) Date: 2010-11-02 23:52
I don't know anything about the Tcl development process either. Luckily, Tk is hosted on SourceForge so it was just a matter of adding a ticket to their issue tracker.

Hopefully it'll get fixed quickly and the fix will percolate down into Tkinter.
msg120337 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-03 18:27
Date User Action Args
2010-11-03 18:27:39eric.araujosetmessages: + msg120337
2010-11-02 23:52:50rafe.kettlersetmessages: + msg120292
2010-11-02 23:49:29eric.araujosetstatus: open -> closed
resolution: not a bug
messages: + msg120291

stage: resolved
2010-11-02 19:21:33rafe.kettlersetmessages: + msg120246
2010-10-24 20:53:16rafe.kettlersetmessages: + msg119530
2010-10-24 19:14:54eric.araujosetmessages: + msg119525
components: + Windows
2010-10-24 18:23:02rafe.kettlersetmessages: + msg119523
2010-10-24 17:50:21eric.araujosetversions: + Python 3.2
nosy: + eric.araujo

messages: + msg119522

components: - Windows
2010-10-22 16:43:19rafe.kettlersetcomponents: + Windows
2010-10-22 12:28:51r.david.murraysetnosy: + gpolo
2010-10-22 02:34:24rafe.kettlercreate