Skip to content
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

Closed
rafekettler mannequin opened this issue Oct 22, 2010 · 9 comments
Closed

Ugly buttons in some Tkinter objects in Windows #54380

rafekettler mannequin opened this issue Oct 22, 2010 · 9 comments

Comments

@rafekettler
Copy link
Mannequin

rafekettler mannequin commented Oct 22, 2010

BPO 10171
Nosy @merwok
Files
  • uglybuttons.png
  • 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:

    assignee = None
    closed_at = <Date 2010-11-02.23:49:29.701>
    created_at = <Date 2010-10-22.02:34:24.897>
    labels = ['invalid', 'expert-tkinter', 'OS-windows']
    title = 'Ugly buttons in some Tkinter objects in Windows'
    updated_at = <Date 2010-11-03.18:27:39.500>
    user = 'https://bugs.python.org/rafekettler'

    bugs.python.org fields:

    activity = <Date 2010-11-03.18:27:39.500>
    actor = 'eric.araujo'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-11-02.23:49:29.701>
    closer = 'eric.araujo'
    components = ['Tkinter', 'Windows']
    creation = <Date 2010-10-22.02:34:24.897>
    creator = 'rafe.kettler'
    dependencies = []
    files = ['19330']
    hgrepos = []
    issue_num = 10171
    keywords = []
    message_count = 9.0
    messages = ['119359', '119522', '119523', '119525', '119530', '120246', '120291', '120292', '120337']
    nosy_count = 3.0
    nosy_names = ['gpolo', 'eric.araujo', 'rafe.kettler']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue10171'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    @rafekettler
    Copy link
    Mannequin Author

    rafekettler mannequin commented Oct 22, 2010

    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.

    @merwok
    Copy link
    Member

    merwok commented Oct 24, 2010

    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.

    @merwok merwok removed the OS-windows label Oct 24, 2010
    @rafekettler
    Copy link
    Mannequin Author

    rafekettler mannequin commented Oct 24, 2010

    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.

    @merwok
    Copy link
    Member

    merwok commented Oct 24, 2010

    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.

    @rafekettler
    Copy link
    Mannequin Author

    rafekettler mannequin commented Oct 24, 2010

    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.

    @rafekettler
    Copy link
    Mannequin Author

    rafekettler mannequin commented Nov 2, 2010

    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
    tk_messageBox
    tk_chooseColor

    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.

    @merwok
    Copy link
    Member

    merwok commented Nov 2, 2010

    Thanks for hunting that down. Agreed about closing.

    I have no inkling about the Tcl development process. Can you report the bug to them?

    @merwok merwok closed this as completed Nov 2, 2010
    @merwok merwok added the invalid label Nov 2, 2010
    @rafekettler
    Copy link
    Mannequin Author

    rafekettler mannequin commented Nov 2, 2010

    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.

    @merwok
    Copy link
    Member

    merwok commented Nov 3, 2010

    Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant