New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ugly buttons in some Tkinter objects in Windows #54380
Comments
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
tkMessageBox.showinfo()
import tkColorChooser
tkColorChooser.askcolor() 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. |
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. |
If you were to create a FileDialog, you should see proper buttons (at least I do in Windows): import tkFileDialog
tkFileDialog.askopenfile() 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. |
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. |
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 tk.call(). 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 tk.call 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. |
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. |
Thanks for hunting that down. Agreed about closing. I have no inkling about the Tcl development process. Can you report the bug to them? |
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. |
Thanks! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: