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

I tried the sollution described on issue #8 but <<Closed>> event was causing the option not being selected when clicling on it #34

Open
lucasadsouza opened this issue May 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lucasadsouza
Copy link

lucasadsouza commented May 4, 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:

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)

@Akascape Akascape added the enhancement New feature or request label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants