Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

[Bug] MacOS TK/TTK buttons appear enabled when disabled

Ouverte
#6,316 15 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
python
Domaine
desktop, frontend

Piste de recherche

Commencez par la reproduction de bouton fournie et comparez les captures d’écran MacOS et Windows, en vous concentrant sur les boutons tkinter désactivés et les paramètres signalés button_color, disabled_button_color et use_ttk_buttons. Le travail est terminé lorsque les boutons désactivés ont un repère visuel clair sur MacOS sans modifier l’apparence des boutons activés.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Platform Specific Issue - Mac
Type of Issue (Enhancement, Error, Bug, Question)

Question

Operating System

MacOS Ventura 13.2.1

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Version information can be obtained by calling sg.main_get_debug_data()
Or you can print each version shown in ()

Python version (sg.sys.version)

Python Interpeter: c:\Users\Eric\code\ztoolkit.venv\Scripts\python.exe
Python version: 3.11.2
Platform: Windows
Platform version: ('10', '10.0.22000', 'SP0', 'Multiprocessor Free')
Port: PySimpleGUI
tkinter version: 8.6.12
PySimpleGUI version: 4.60.4.135
PySimpleGUI filename: c:\Users\Eric\code\ztoolkit.venv\Lib\site-packages\PySimpleGUI\PySimpleGUI.py


Your Experience In Months or Years (optional)

Years Python programming experience
5
Years Programming experience overall
5
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
no
Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • #6322
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description

I can't seem to get button_color, or disabled_button_color to work on MacOS. Strangely enough, themes do work. In my app, I initially disable some buttons until certain conditions are met. On Windows, this works well since there is a visual cue (greyed text) that the button is disabled. On, Mac, there is no visual cue; the button is disabled but appears enabled.

I tried setting sg.Window(use_ttk_buttons = False) as well to no effect whatsoever. Using button_color, or disabled_button_color also has no effect.

Is this expected behavior due to some limitation or is it layer 8?

Thank you kindly in advance!

Code To Duplicate

A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)

This pre-formatted code block is all set for you to paste in your bit of code:


        # Elements
        frame_zvpn_actions = [
            [sg.Button(' VPN Logs ', key='-LOGS_ZVPN-', disabled=True, tooltip='Fetch the VPN tunnel logs')
            ,sg.Button(' SA Status ', key='-STATUS_ZVPN-', disabled=True, tooltip='Instance mode only. Show the VPN tunnel SA and policy status')
            ,sg.Button(' IKEv1 Debug ', key='-DEBUG_ZVPN-', disabled=True, tooltip='Instance mode only. IKEv1 only. Run a debug for an IKEv1 tunnel')
            ,sg.Button(' Copy CMDs ', key='-COPY_CMD_ZVPN-', disabled=True, tooltip='Copy the CLI commands to the clipboard')
            ,sg.Button(' Save ', key='-SAVE_ZVPN-', disabled=True, tooltip='Save the all outputs to a workflow or file')
            ,sg.Button(' Reset ', key='-RESET_ZVPN-', disabled=False, tooltip='Reset all the fields')]
        ]

        # Layout
        tab_ZVPN_layout = [
            [sg.Button('?', pad=PAD_HBUT5, font=TXTB_FONT, key='-BTN_ZVPN-')
            ,sg.Text('Info: Locate a ZVPN node and grep the VPN logs. Select a mode first.', pad=PAD5, font=TXTB_FONT)]
            ,[sg.Frame('Actions', pad=PAD_FRAME6, font=TXTB_FONT, layout=frame_zvpn_actions, expand_x=False, 
 expand_y=False)]
        ]

        # Main window
        window = sg.Window(
            f'zToolkit (zTK) v{ver}', layout=layout, size=SZ_MAIN
            ,resizable=False, finalize=True, element_justification='center', icon=iconB64
        )

    # Main loop
    while True:
        try:
            windows, event, values = sg.read_all_windows()
            threadCountLoop = threading.active_count()
            threadEnumLoop = threading.enumerate()
            logger.debug(f'[__main__:threadCountLoop] Thread count: {threadCountLoop}')
            logger.debug(f'[__main__:threadEnumLoop] Active threads: {threadEnumLoop}')
            #===== Main GUI =====#
            # Main - Exit
            if event == sg.WIN_CLOSED or event == 'Exit::-EXIT_MAIN-': # If user closes window or clicks Exit button
                connRunning = False
                winClosed = True # Stop session keepalive loop
                break
Screenshot, Sketch, or Drawing

MacOS
image

Red = Disabled button
Green = Enabled button

Windows
image

Red = Disabled button
Green = Enabled button


Watcha Makin?

A ZTNA cloud troubleshooting toolkit for my team.

If you care to share something about your project, it would be awesome to hear what you're building.

Langage dominant
Python
Étoiles
13.8k
Forks
1.8k
Métriques de merge des PR
Aucune PR mergée en 30 j

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PySimpleGUI/PySimpleGUI

Toutes les issues de PySimpleGUI/PySimpleGUI

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.