j4321 / tkcalendar

Calendar widget for Tkinter
https://pypi.python.org/pypi/tkcalendar
GNU General Public License v3.0
97 stars 33 forks source link

application freeze unless any key is pressed #81

Open bobjohnbobjohn opened 2 years ago

bobjohnbobjohn commented 2 years ago

hi, with a dateentry in my code, the application sometimes freezes and it is only possible to "unfreeze" it by pressing any key. I use 'Alt' key for instance because it does nothing and allows me to display the widgets.

with a Ctrl+c in the terminal that launches the application, one can see that the code is actually stuck in an update_idletasks() function of dateentry.py

$ python main.py 
^CTraceback (most recent call last):
  File "main.py", line 127, in <module>
    MyAppName(root)
  File "main.py", line 43, in __init__
    self.create_widgets()
  File "main.py", line 63, in create_widgets
    self.tv_usage.create_treeview_interne()
  File "/path/to/myappname/gui/view_interne.py", line 44, in create_treeview_interne
    self.p.e_interne_date = DateEntry(fr_interne_head, selectmode='day', width=18)
  File "/path/to/.virtualenvs/myappname/lib/python3.8/site-packages/tkcalendar/dateentry.py", line 138, in __init__
    self._setup_style()
  File "/path/to/.virtualenvs/myappname/lib/python3.8/site-packages/tkcalendar/dateentry.py", line 187, in _setup_style
    self.update_idletasks()
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1311, in update_idletasks
    self.tk.call('update', 'idletasks')
KeyboardInterrupt

I use python 3.8.0 and tkcalendar 1.6.1 on an ubuntu system