PySimpleGUI / PySimpleGUI/PySimpleGUI

[Bug] Failed to input after sg.CalendarButton event in macOS Catalina

Open
#3,893 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Platform / Config Problem Platform Specific Issue - Mac
Dominant language
Python
Stars
13.8k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Type of Issues (Enhancement, Error, Bug, Question)

Bug

Operating System

macOS Catalina Version 10.15.6

Python version

3.9.1

PySimpleGUI Port and Version

Ports = tkinter, Qt, WxPython, Web

PySimpleGUI Version: 4.34.0

tkinter version: 8.6.8

You can get these by adding this to the top of your file and running it:

import PySimpleGUI as sg

print(sg)             # Location of your PySimpleGUI.py file
print(sg.version)     # PySimpleGUI version number
print(sg.tclversion_detailed)   # tkinter detailed version number (in PySimpleGUI version 4.29.0+)
print(sg.sys.version) # Python version number

The tkinter version number can be obtained using above code in version 4.29.0+. If your code is prior:

print(sg.tkinter.Tcl().eval('info patchlevel'))
Your Experience Levels In Months or Years

1.5_ Python programming experience
1.5_ Programming experience overall
_no Have used another Python GUI Framework (tkinter, Qt, etc) previously (yes/no is fine)?

You have completed these steps:
  • [ x] Read instructions on how to file an Issue
  • [x ] Searched through main docs http://www.PySimpleGUI.org for your problem
  • [ x] Searched through the readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • [x ] Looked for Demo Programs that are similar to your goal http://www.PySimpleGUI.com
  • [ x] Note that there are also Demo Programs under each port on GitHub
  • [x ] Run your program outside of your debugger (from a command line)
  • [ x] Searched through Issues (open and closed) to see if already reported
  • [x ] Try again by upgrading your PySimpleGUI.py file to use the current one on GitHub. Your problem may have already been fixed but is not yet on PyPI.
Description of Problem / Question / Details

I run my program and it opens just fine. I can type in the input fields, but as soon as i open up the calendar it no longer allows me to type in the input fields. The program works perfect on windows, but as soon as i use it on mac it has issues.

Code To Duplicate

A short program that isolates and demonstrates the problem (i.e. please don't paste a link to your 400 line program.... instead paste your 10 line program in full).

Yes, it is a pain to narrow down problems, but it's part of the debugging process. Help me help you by providing something that can be executed so that work on getting you a fix or a workaround can immediately begin.

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

This is not my exact code, but this has the same issue. Type in the input field, then use calendar button then you can no longer type in the input field.

import PySimpleGUI as sg

layout = [[sg.Text('Date Chooser Test Harness', key='-TXT-')],
      [sg.Input(key='-IN-', size=(20,1)), sg.CalendarButton('Cal US No Buttons Location (0,0)', close_when_date_chosen=True,  target='-IN-', location=(0,0), no_titlebar=False, )],
      [sg.Button('Read'), sg.Button('Date Popup'), sg.Exit()]]

window = sg.Window('window', layout)

while True:
    event, values = window.read()
    print(event, values)
    if event in (sg.WIN_CLOSED, 'Exit'):
        break
    elif event == 'Date Popup':
        sg.popup('You chose:', sg.popup_get_date())
window.close()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided CalendarButton reproduction on macOS Catalina, then trace the tkinter CalendarButton event and input focus behavior. The issue is done when typing in the input field still works after opening and closing the calendar, while the supplied program continues to reproduce correctly on the affected platform.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.