I have my TopLevel using grab_set to avoid it getting behind the main window. But it was causing that when I clicked to select an option on the combobox, it just hides without calling the command callback.
I tried the solution described on issue #8 and it didn't work at all. Testing I found out that "<>" event was causing the issue. So I replaced on my code:
music_genre_combo.bind("<<Closed>>", lambda _: metadata_window.grab_set())
to:
music_genre_combo.on_close = metadata_window.grab_set
and on CTkScrollableDropdown\ctk_scrollable_dropdown.py I changed the self._withdraw method to:
def _withdraw(self):
if self.winfo_viewable() and self.hide:
self.withdraw()
self.on_close() # Here I called the "on_close" I set on my code.
self.event_generate("<<Closed>>")
self.hide = True
It solved the problem completely. Since I didn't studied the code completely I don't know if it may cause any colateral effects, thus I'm not creating a pull request, just registering the solution here for anyone that have the same problem or to be added to the next update.
Thanks!
System: Windows 10 Pro
Python: 3.11.8
CustomTkinter: 5.2.2
CTkScrollableDropdown: 1.0 (Downloaded on 05/04/2024)
I have my TopLevel using grab_set to avoid it getting behind the main window. But it was causing that when I clicked to select an option on the combobox, it just hides without calling the command callback.
I tried the solution described on issue #8 and it didn't work at all. Testing I found out that "<>" event was causing the issue. So I replaced on my code:
to:
and on CTkScrollableDropdown\ctk_scrollable_dropdown.py I changed the self._withdraw method to:
It solved the problem completely. Since I didn't studied the code completely I don't know if it may cause any colateral effects, thus I'm not creating a pull request, just registering the solution here for anyone that have the same problem or to be added to the next update.
Thanks!
System: Windows 10 Pro
Python: 3.11.8
CustomTkinter: 5.2.2
CTkScrollableDropdown: 1.0 (Downloaded on 05/04/2024)