Python 2.7 (32-bit) Windows: We're experimenting with Python 2.7's support for themed Tkinter (ttk) for simple GUI's and have come away very impressed!! The one area where the new theme support seems to have come up short is how OS specific common dialogs are wrapped.

Corrected: In other words, the MessageBox and ColorChooser common dialogs have "ugly" looking Win 95 style blocky looking buttons vs. the themed (rounded/gradient) buttons that normally show up on these common dialogs under XP, Vista, and Windows 7. (I'm testing on all 3 platforms with identical, un-themed results).

Note: The filedialog common dialogs (askopenfilename, askopenfilenames, asksaveasfilename, askdirectory) are all properly themed.

This is a great catch. I'm going to bring this to the Bug Tracker at Python and see if we can make some headway.
–
Rafe KettlerOct 22 '10 at 2:23

Rafe: Thank you for updating the Python Bug Tracker with this problem. I would be more than happy to help correct this problem. I'm not sure what I can contribute code wise, but I would be happy to test any code fixes on multiple versions of Windows, eg. XP, Vista, Windows 7.
–
MalcolmOct 22 '10 at 16:35

Here's a link to the issue, you can always look at the source and see if there's a way to correct the source. The way things work is, while you can't commit code unilaterally, anyone can write patches and have them looked at. bugs.python.org/issue10171
–
Rafe KettlerOct 22 '10 at 16:42

An editorial bit: to format inline strings a code put them in backquotes and to format a long piece of code indent it by four spaces. Your edit broke the formatting I did in the earlier edit.
–
Muhammad AlkarouriOct 22 '10 at 19:32

1 Answer
1

Your observation is mainly correct. I do see what you are referring to in the messagebox and the colorchooser. However, my filedialogs all seem to have properly rounded buttons, etc.

My recommendation for you on making the messagebox is to create your own messagebox using the TopLevel widget, and then define what you need on it and the appropriate behavior for the different buttons (it's definitely a bit harder than just using a messagebox, but if you really need the new style buttons, it'll work).

I don't think you can hack together a solution for the colorchooser problem, however.

I though for a minute that perhaps Python 3.1 had fixed this problem, but sadly, I tried and that isn't the case. I suppose if you need the user to pick a color, the buttons will have to be ugly.

Rafe: Yes, you are correct ... the filedialogs DO render as expected with support for themed (rounded) buttons. The lack of theme support appears to be limited to the messagebox and colorchooser dialogs.
–
MalcolmOct 22 '10 at 16:39

I've also noticed the following oddity: All the filedialogs (and the colorchooser) display relative to the upper left corner of the parent window ... EXCEPT the askdirectory() dialog which centers itself on the desktop.
–
MalcolmOct 22 '10 at 16:43